How to differentiate a Job from a Job Sequence in script

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

PTERM CASE INVERT as a default stems from the early days if UniVerse (and precursor products) when the input device was a teletypewriter that only had upper case; this default recognizes the fact that most components are named in all upper case because of this historical artifact. You can institute automatic change of the default in the LOGIN paragraph.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

I tried this from my home directory in a bash shell:

Code: Select all

sbass1:~ > uvsh <<EOF
> LOGTO DEV_GGS
> SELECT JOBTYPE,NAME FROM DS_JOBS WHERE NAME='TestJob_Seq' AND JOBTYPE='2'
> EOF
This directory is not set up for DataStage.
Would you like to set it up (Y/N)?LOGTO DEV_GGS
So, is there any way to invoke uvsh or dssh without actually cd'ing to a project directory?
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You have to start from either $DSHOME or a Project directory to avoid that question... which should always be answered 'NO' by the way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

As always, thanks for the help Craig. Genuinely appreciated.

In case others might find this useful, here is my final (test) script. It was slightly tricky getting the here document output captured in a variable, but Google saved the day:

Code: Select all

#!/bin/bash

cd $DSHOME
FOUND=$(uvsh <<EOF | egrep 'records listed' | cut -f1 -d" "
LOGTO $1
SELECT NAME,JOBTYPE FROM DS_JOBS WHERE NAME='$2' AND JOBTYPE='2';
EOF)

echo $FOUND
$1 is the Project Name
$2 is the JobName

Returns 1 if JobName is a sequence, 0 if JobName is not a sequence.
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

A slight addition to the long discussion :D

Not all of my sequences are checkpointed and my intension is to figure out if the sequence i am running is checkpointed or not (by looking into the repository) and based on this either to reset or leave it in aborted/restartable status

Any info would be greatly appreciated

Thanks
- Zulfi
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

Guru's, could some one please help in the above query ?
- Zulfi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No clue and obviously not something documented either. Have you asked your official support provider?
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Here are sample Director messages for a checkpointed job, with actual names genericized:

Code: Select all

<sequence job name>..JobControl (@Coordinator): Starting new run of checkpointed Sequence job

<sequence job name>..JobControl (@<sequence stage 1 name>): Checkpointed run of job '<job 1 called by sequence stage 1>'

<sequence job name>..JobControl (@<sequence stage 2 name>): Checkpointed run of job '<job 2 called by sequence stage 2>'

<sequence job name>..JobControl (@Coordinator): Removed checkpoint record at successful completion of sequence
In light of past threads discussing extracting log messages, I suppose you could use those to find checkpointed jobs, and have negative proof that jobs that lack those messages are not checkpointed.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply