Page 1 of 1

Parameters from File

Posted: Fri Jan 20, 2006 7:19 am
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

Posted: Fri Jan 20, 2006 7:31 am
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

Posted: Fri Jan 20, 2006 1:59 pm
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")

Posted: Fri Jan 20, 2006 10:00 pm
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

Posted: Sat Jan 21, 2006 3:28 am
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

Posted: Sat Jan 21, 2006 3:55 am
by bala_135
Hi Kumar,

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

Regards,
Bala

Posted: Sat Jan 21, 2006 3:57 am
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

Posted: Sun Jan 22, 2006 3:00 am
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

Posted: Sun Jan 22, 2006 7:09 am
by manojmathai
HI

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

Regards
Manoj.

Posted: Sun Jan 22, 2006 10:16 pm
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