Processing files in a directory

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

Moderators: chulett, rschirm, roy

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Both the Server Job Developers Guide and the Parallel Job Developers Guide have a chapter on job sequences, in which all available job sequence components are described. You can also garner information from on-line help in Designer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Executing DSRunJob command

Post by sashah »

To execute the DSRun job comman from prompt do we need to write the script in C? The example in the Server Job Developers guide is written in C
ray.wurlod wrote:Both the Server Job Developers Guide and the Parallel Job Developers Guide have a chapter on job sequences, in which all available job sequence components are described. You can also gar ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no such thing as a 'script' written in C. You're probably seeing example C code from the dsjob application itself or how some of the functions themselves are implemented in it.

There are no script examples in the Guide from what I recall, but descriptions of all of the functions available as part of dsjob. You'd need to build an appropriate script using whichever of those components are applicable for your situation.

If you're not that much of a scripting wiz, there are one or two full blown examples here users have posted of 'wrapper' scripts for dsjob that a search would turn up. Perhaps one of them could help you get started?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Thank you for all your help.
Can you tell me which reference manual to refer to for calling the DSJob from a Unix prompt. I found some older post in this forum regarding the same but I could not find the reference manual to refer to. I have already written a shell script that loops through files in a directory and would like to pass the file name as a parameter.

Thanks once again.
chulett wrote:There's no such thing as a 'script' written in C. You're probably seeing example C code from the dsjob application itself or how some of the functions themselves are implemented in it.

There are no script examples in the Guide from what I recall, but descriptions of all of the functions available as part of dsjob. You'd need to build an appropriate script using whichever of those components are applicable for your situation.

If you're not that much of a scripting wiz, there are one or two full blown examples here users have posted of 'wrapper' scripts for dsjob that a search would turn up. Perhaps one of them could help you get started?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Check the section 'Command Line Interface' in Server Job Developer's Guide.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Thank you.
DSguru2B wrote:Check the section 'Command Line Interface' in Server Job Developer's Guide.
Ed Purcell
Premium Member
Premium Member
Posts: 23
Joined: Fri Mar 28, 2003 5:41 pm
Location: USA

Post by Ed Purcell »

nick.bond wrote:
or you could use wildcards if your file names are amenable)
Ray, I recently found that I couldn't use wildcards in the filter command. Craig also found the same issue. Do you know that it can be done? Is there some specific syntax to get it to work? Or is it just not working in our versions of DS. 7.5.1
Do you mean using wild cards in a File Pattern as the input into a sequential file stage in EE / PX?
EPCCTX
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, wildcards in the Filter option of the Server Sequential File stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

I am still not clear on how to use the Filter option to process files in a directory.
chulett wrote:No, wildcards in the Filter option of the Server Sequential File stage. ...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I haven't had the chance to check yet. It may be that you need to quote the entire thing (remember parameters with spaces?).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sashah wrote:I am still not clear on how to use the Filter option to process files in a directory.
By using wildcards there to 'cat' multiple files to standard out, which the Sequential File stage would then read as input. Saves the disk space needed for the combined file if it works for you, it wouldn't for me last time I tried. And tried. I stopped trying. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Thank you for your reply. I am going to try this. However I had a question related to command line interface. How do you pass multiple parameters to DSJob ?

Is it -param name1=value1,name2=value2 or -param name1=value1 -param name2=value2

Thank you again.
chulett wrote:
sashah wrote:I am still not clear on how to use the Filter option to process files in a directory.
By using wildcards there to 'cat' multiple files to standard out, which the Sequential File stage would then read as input. Saves the disk space needed for the combined file if it works for you, it wouldn't for me last time I tried. And tried. I stopped trying. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sashah wrote:or -param name1=value1 -param name2=value2
That way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

Thank you
chulett wrote:
sashah wrote:or -param name1=value1 -param name2=value2
That way.
sashah
Participant
Posts: 37
Joined: Thu May 10, 2007 3:02 pm

Post by sashah »

I get Invalid Arguments.

This is the command I am executing.

eval $DATASTAGE_HOME/DSEngine/bin/dsjob -run -warn -param accountNumber=$accountNumber -param fileName=$fileName -param lookUpFile=$lookupFilePath -param outputFileName=$outputFile -warn 5 MuniStQa MLConvertibleHistoryLoad

Am I missing something.

Thank you
sashah wrote:Thank you
chulett wrote:
sashah wrote:or -param name1=value1 -param name2=value2
That way.
Post Reply