Page 1 of 1

Check the Data is ready from Source

Posted: Wed Oct 24, 2007 3:28 pm
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.

Posted: Wed Oct 24, 2007 3:50 pm
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.

Check the Data is ready from Source

Posted: Wed Oct 24, 2007 5:17 pm
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..

Posted: Wed Oct 24, 2007 5:34 pm
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.

Posted: Wed Oct 24, 2007 6:33 pm
by ArndW
Use an external command stage calling "wc -l /my/file/path/testfile.txt" and check the return value for your size.