Parameters from File

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
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Parameters from File

Post by bala_135 »

Hi,

I am a text file which has the parameters of a job.

I am writing a jobControl in the job

OPENSEQ 'D:\F2.TXT' TO F5 ELSE ABORT
READSEQ R1 FROM F5 ELSE ABORT
A :=R1
J1=DSAttachJob(Job1, ErrorMode)
Errocode=DSSetParam(J1,"Param1",A).

When I run this job its working fine.The parameter for the job J1 is set.

Now how do I set the parameters for the same job.
I have tried using the jobhandle DSJ.ME but the parameter is not setting the job fails

If the case is I cannot set the parameters for the same job then in sequence job control also this prevails so do i need to hand code the parameters for my first job in the sequence.Correct me if am wrong somewhere.

Regards,
Bala
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi,

Yes you cannot pass the parameter value from the job itself.
You need to pass it from another job control, or from a sequence itself.

-Kumar
mkeevil
Participant
Posts: 59
Joined: Mon Jul 14, 2003 12:59 pm
Location: USA

Post by mkeevil »

You have to open the file in something else, we use a control batch job and the code looks like :

OpenSeq "G:\DataStage\DStage_Data\ACSPROD1_Control.txt" To INLINE Then
ReadSeq DataLine from INLINE Then
Server = Trim(DataLine)
End
CloseSeq INLINE
End
Call DSLogInfo("AS400 Control: ":Server,"Job Control")
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Post by bala_135 »

Hi Kumar,

In sequence i am not able to edit the job control. so i can't pass the parameters from the sequence, is there any thing i can do about.

Hi mKeevil,

thank you for the suggesions. I'll try it out.


Regards,
Bala
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Bala,

You can hard code the constant values in sequence and pass it to the underlying called jobs. Steadily changing values can be fed to the main sequnce by any batch program or an .bat which reads the parameter file and pass it.
Else use the batch code itself to call the jobs and so passing the value of the parameters to it.
If necessary the bunch of jobs can be called by a batch and the sequnce of the batch can be configured in a sequence.

-Kumar
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Post by bala_135 »

Hi Kumar,

I have done exactly the same thing and achieved what I want.Thank you very much.

Regards,
Bala
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi bala,

Do you mean to say that passing pameter value from the job itself. :roll:
Is it possible for you to share the same with us.

-Kumar
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Post by bala_135 »

Hi kumar,

I have tried both ie calling the job from batch job in Job control and also i tried calling a job in the job-control in a 'job" without having any stages.Both worked.I found that i cannot call the parameters of the same job in the job control.

thank you,
Bala
manojmathai
Participant
Posts: 23
Joined: Mon Jul 04, 2005 6:25 am

Post by manojmathai »

HI

Can you please do a DSLogInfo and see if the parameter is read from the file correctly or not.

Regards
Manoj.
bala_135
Premium Member
Premium Member
Posts: 156
Joined: Fri Oct 28, 2005 1:00 am
Location: Melbourne,Australia

Post by bala_135 »

Hi Manoj,

What's the problem.My second job is executing fine with the parameters passed from the first job or from a Batch job.Why DSlogInfo.

REgards,
Bala
Post Reply