Page 1 of 1

Sequential FIle Scenario

Posted: Tue May 24, 2011 3:34 am
by ashish10mca
Hi..

I am facing a problem to develop below scenarion in datastage 7.5.

SCENARIO:

How to catch a string pattern from sequential_file source (just like grep in UNIX) . and if able to catch a pattern then how to send as an parameter for next job on run time??

Please Suggest..??

Posted: Tue May 24, 2011 3:41 am
by devesh_ssingh
use index function to search 1st occurance of pattern then pass the same in jp.
search same in forum you will get more info

Posted: Tue May 24, 2011 4:56 pm
by ray.wurlod
devesh_ssingh wrote:use index function to search 1st occurance of pattern then pass the same in jp.
Justice of the Peace?

Please don't use potentially ambiguous or unclear abbreviations.

Posted: Tue May 24, 2011 6:07 pm
by SURA
Guess: You are going to check this value which is one of the col in the file.

Seq File > TFM

Write a routine and use that routine in TFM and pass that col as a param and find the result. So that it can be used as a param.

DS User

Posted: Wed May 25, 2011 12:14 am
by singhald
as suggested in earlier post. you can use index function to search for string and write it into sequential file in job1.

Then write a datastage server routine which accept file path and name and return you the value stored in file.

in job sequence use user variable activity add valriable and call datastage server routine , provide file level inputs. it will assign the value stored in file to user variable. which you use in any job next in sequencer.

Posted: Wed May 25, 2011 12:15 am
by ray.wurlod
Why re-invent the wheel? Your putative routine does precisely what the Index() function accomplishes.

To the OP, you could also use grep as a Filter Command in the Sequential File stage or in an External Source stage.