job parameters in job control code

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
hiltsmi
Participant
Posts: 20
Joined: Thu Aug 04, 2005 9:03 am

job parameters in job control code

Post by hiltsmi »

I have a job parameter called input_file.

In my job control code I try to open the file with the following code

OPENSEQ "#input_file#" TO FILE THEN

The job control parameter has a default value.

I added some logging statements to see what is happening and it appears that the job parameter is not being expanded.

When are job parameters evaluated by datastage?
Can job parameters be used in the before-job and after-job subroutines?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The syntax in the Job Control code should read:

Code: Select all

OPENSEQ input_file TO FILE THEN {...}
You do not need to specify the # hash marks in Job Control code to use parameters, and the quotes you used are also extraneous.

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

Post by ray.wurlod »

If you want to make it pellucid, specify DSGetParamInfo() explicitly.

Code: Select all

InputFileName = DSGetParamInfo(DSJ.ME, "input_file", DSJ.PARAMVALUE)

OpenSeq InputFileName To FileVariable...
You should always specify a LOCKED clause with OpenSeq. Since OpenSeq sets an update lock, you need to be certain that the lock is not already owned by some other process.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply