0

I'm working with DataStage 11.3 with parallel jobs.

My input is a date and I use the "DateOffsetByComponents" function in a -transformer- stage to obtain 4 dates with different rules, these 4 results ends in different -sequential file- stages.

The next step of my transformation is to make a query in Sybase but, the conditional clause "Where" uses the 4 dates mentioned before as parameters to get the proper information from the DB.

Does anybody have an idea of how can I read the date in each sequential file and put these as a parameter in the next step?

I read a similar question of it in which, he suggested use the -execute command- stage in a Sequence job but I'm new using DataStage and it isn't clear for me on how can I achieve this, although, I can see that, in this type of job (Sequence) you can select parameters that are contained in others -job activities- stages.

Thanks a lot in advance

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
PinkAndi
  • 1
  • 1

1 Answers1

0

Yes, an Execute Command activity to read the date from each file is the way to go. Figure out an operating system command to extract the information you need, perhaps some combination of grep and sed, and use this as the command. The command output is available in an activity variable called $CommandOutput. For example, if your file contains the line "Date: 2021-11-17" then a suitable command might be grep Date: filename | cut -f2 You might like to add a tr command to the pipeline to remove the trailing newline character. You'll need one Execute Command activity per file. Access the required date from the $CommandOutput activity variable for each.

Ray Wurlod
  • 831
  • 1
  • 4
  • 3