Check the Data is ready from Source

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rkpatlolla
Participant
Posts: 7
Joined: Thu Aug 16, 2007 12:11 am

Check the Data is ready from Source

Post by rkpatlolla »

Need to design a job where I have to check whether the data from source is ready or not. i have to check for 3 conditions. I have to read a Table T_LKP_JOB_STATUS from Source which has 3 columns in it JOB_RUN_DT, JOB_STATUS and JOB_DESC. if i find that all 3 columns are successful then i have to return a good code else return a bad code saying that the data is not ready yet.
Ravi Kiran
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ravi, although you didn't ask a question I'll assume you want to know how to do this. You can write a simple job to do this read and write 1 or 0 records to a sequential file. Then, from a sequencer job, you can check this file's size to determine how to proceed. Alternately, you can set the user return code in the original job and query that in the sequencer. There are very many different solutions to using a table's contents to control processing and which one you choose depends upon your installation and other factors that we at DSXchange cannot know.
rkpatlolla
Participant
Posts: 7
Joined: Thu Aug 16, 2007 12:11 am

Check the Data is ready from Source

Post by rkpatlolla »

i have my job ready but didnt know how to check the file size inside a sequencer. can you please elaborate on it.. i am new to datastage. thanks for the help..
Ravi Kiran
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Make a check T_LKP_JOB_STATUS job which will read all the 3 columns - JOB_RUN_DT, JOB_STATUS and JOB_DESC in the status table. Pass this to a transformer stage in this job and if 'all 3 columns are successful' , as noted earlier in this thread set your USERSTATUS (Search the forums for USERSTATUS) to 1. In your sequence check for USERSTATUS to determine data is ready or not.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use an external command stage calling "wc -l /my/file/path/testfile.txt" and check the return value for your size.
Post Reply