Script to call map reiteratively

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
CIPSguy
Participant
Posts: 2
Joined: Mon Dec 04, 2006 2:49 pm

Script to call map reiteratively

Post by CIPSguy »

I'm a newbie to DSTX...only a couple weeks' experience thus far with DSTX 8.0.1.

I have created type trees and a map, and run the map successfully by specifying input card Source = "File" and specifically naming my test input file in parameter FilePath.

But how to run this in production, where I must direct the map to an input folder where zero to several input files are waiting to be processed? Seems like I need to write a script to run the map reiteratively, once per file found in the input folder. Pseudo-code for such a script would look something like this:

Read input folder
Do until no more files in input folder
Copy input file to <FilePath specified in map's input card>
Run map
Delete <FilePath specified in map's input card>
Move input file to archive folder
Loop

Is this the best way to handle this task? If so, is there a preferred language for writing the script (VBscript or simple command file, whatever) to run in the DSTX Command Server environment? Can anyone provide me with sample code?

Or - am I missing the point of another function (like specifying input card Source = "Batch File" or "Shell Script") which I have been unable to figure out thus far?

Thanks.

- Dale
Dale Childs
Technical Business Analyst
Scottsdale Insurance Company
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

You need to have the Event Server installed. Then create a system file using the Integration Flow Designer and specify in your file name something like path\*.txt to pick up all files with a .txt extension. The system file needs to be generated into the system folder that the event server is configured to use.
Post Reply