how to check if file exists

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jeisma
Participant
Posts: 18
Joined: Mon Mar 20, 2017 12:19 pm

how to check if file exists

Post by jeisma »

hi,

the op in this link pretty much describe what i need.

viewtopic.php?p=313299

however, i could not find execute command stage in my pallet.

any idea how to check if file exists, and rename afterwards before running the job runs?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Execute Command activity is only in your Palette if a Sequence job is in focus in your Designer client. So you could do the check in the sequence that controls your job.

You could also use a before-job subroutine, but the only alternatives this gives you are to allow the job to run or to abort the job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

You can make an execute command routine in C++ to use in your parallel jobs for this sort of thing.

it is literally just this function:

Code: Select all

int wrapper(string s)
{
  system(s);
 //parse and return a value, 0 or 1 maybe, or the output of the system command
  return (something);
}
There are other ways. This one is just really simple.
jeisma
Participant
Posts: 18
Joined: Mon Mar 20, 2017 12:19 pm

Post by jeisma »

thank you so much for the tips.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Under parallel job properties, on the General tab, the Before-job subroutine drop-down includes DSWaitForFile. I've not used it, but your manuals should have what you need to use it.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply