Page 1 of 1

Scheduling Sequencer

Posted: Tue Oct 11, 2005 8:50 am
by edward_m
HI All,

We got a seuencer job with parameters and i would like to schedule that job.We used to run this sequencer manually then we enter parameter values when its prompted.
Please let me know how to pass parameters when we schedule this sequencer job.
Any help would be appreciated.

Thanks.

Posted: Tue Oct 11, 2005 9:01 am
by kcbland
You need to feed the parameters to your sequence using some sort of job control logic to fetch the values from wherever you put them. One method is a parameter file, the other is a database table. If your parameters are derived at runtime, that is a third source. However you achieve your values for the parameters, you must use a job control program such as a Batch job to run your Sequencer, setting the appropriate values. Now, you schedule the Batch job instead of the Sequencer. The Batch job fetches the parameters and then runs the Sequencer.

Posted: Tue Oct 11, 2005 9:10 am
by edward_m
KCBLAND,

Could you please explain me how to achieve this using parameter file.

Thnaks

Posted: Tue Oct 11, 2005 9:22 am
by khanparwaz
Try utilityrunjob utility to pass parameters.

Khan

Posted: Tue Oct 11, 2005 9:24 am
by kcbland
Create a text file that holds arguments. I'd suggest something like this:

Code: Select all

[Directories]
DirArc=c:\KBA\BOT\work\archive\${ProcessDate}
DirScriptCommon=c:\KBA\BOT\work\scripts
DirError=c:\KBA\BOT\work\errors
DirHash=c:\KBA\BOT\work\hash
DirLoad=c:\KBA\BOT\work\load
DirLog=c:\KBA\BOT\work\logs
DirPoll=c:\KBA\BOT\work\polling
DirReject=c:\KBA\BOT\work\rejects
DirScript=c:\KBA\BOT\work\scripts
DirSource=c:\KBA\BOT\work\source
DirTemp=c:\KBA\BOT\work\temp
DirWarn=c:\KBA\BOT\work\warnings

[Servers]
DBserverPSA=psahost.world.net
DBdatabasePSA=psaschema
DBdsnPSA=ODBCpsaschema
DBuseridPSA=datastage
DBpasswordPSA=fdk*392-a

DBserverCDW=cdwhost.world.net
DBdatabaseCDW=cdwschema
DBdsnCDW=ODBCcdwschema
DBuseridCDW=datastage
DBpasswordCDW=fdk*392-a


[EMail]
MailList=Kenneth.Bland@KennethBland.com Steve.Boyce@KennethBland.com
EmergencyMailList=Kenneth.Bland@KennethBland.com Steve.Boyce@KennethBland.com
PagerMailList=Kenneth.Bland@KennethBland.com Steve.Boyce@KennethBland.com
JobFailure=ATTENTION!  DataStage job failed
JobStarted=INFORMATION  DataStage job started
JobFinished=INFORMATION  DataStage job finished
JobOverrun=ATTENTION!  DataStage job overrun
JobOverThreshold=ATTENTION!  DataStage job over threshold
MailSender=KennethBland
MailServerName=KBAExchangeServer

[Exception Handling]
JobRuntimeNotificationValue=30
JobRuntimeShutdownValue=60
JobWarningMessageNotificationValue=50
JobWarningMessageShutdownValue=200

[MISC]
NullDate=1799-01-01
SkipParameters=SourceSystemCode
SystemType=NT
NotifyStartStop=Y
PerformJobLinkStatisticsChecks=Y
PerformJobLinkStatisticsChecksDuringRuntime=Y
OutputJobLinkStatistics=Y
PerformDirectorySlashAppending=Y
PerformAuditTableUpdates=Y
AuditTableCriticality=WARN
AuditTableUpdateInterval=5
CompileJobsAtStartup=Y
CompileJobsAtRuntime=N
InspectJobsLogsDuringRuntime=Y
EnvironmentCommand=set
TokenReplacementVariables=fred barney wilma ProcessDate
TokenReplacementLeadDelimiter=${
TokenReplacementEndDelimiter=}
AuditTableUpdateCommand=AuditTableUpdate.bat
MaxParallelJobsGovernor=50

Use DS BASIC inside the Batch job to open the file, read the parameters (see OPENSEQ, READSEQ, CLOSESEQ), derive any you need, the attach to the Sequencer job, set the appropriate parameters, run the job, and check the results. This is easy to see how to do if you create a Batch job from Director. Use the Add button to add the job control logic to the Batch job to run your chosen Sequence job. Now all you have to do is add the logic to get the parameters and use them. This forum is full of examples of people doing this.

Posted: Tue Oct 11, 2005 9:25 am
by chulett
That looks familiar. :wink:

Posted: Tue Oct 11, 2005 11:28 am
by edward_m
KCBLAND,

Here is my environment:
DS Server is running on WINDOWS machine.
I am passing only four parameters in sequencer one time i.e User Name,Password,
SRC DSN and TRG DSN.
I am totally new to this routines,so could you please give me the code to schedure the the above sequencer.

Thanks for your help.

Posted: Tue Oct 11, 2005 11:59 am
by kcbland
You're new to the forum but please spend a few minutes with the Search facility. We've spent years building up a knowledge base of over 20000 posts. You'll find numerous examples of accessing files and tables from DS BASIC that are extremely simple to understand.

You're already 75% done just creating a Batch job and adding your Sequence to it from the drop down. All that's left is to put some lines at the top to open the parameter file, read the lines, and put your values into variables that you'll put into the job control lines where there's currently hardcoded values.

Posted: Tue Oct 11, 2005 12:21 pm
by edward_m
Thanks for your help.
Usually we schedule our jobs(without parameters) using .bat file with following code.
dsjob - run <project-name> <job-name>
Is it possible to pass parameters with dsjob command?

Thanks.

Posted: Tue Oct 11, 2005 12:25 pm
by ucf007
use the option -param ...

Posted: Tue Oct 11, 2005 12:30 pm
by edward_m
Couldyou please give me exact syntax for ds job with params
i.e dsjob - run -param(parametername,value) <project name> <Job name>
Is that above statement correct?

Posted: Tue Oct 11, 2005 12:45 pm
by kcbland
-param parameternameA=parametervalueA -param parameternameB=parametervalueB

Keep in mind that spaces in the parameter value require parameter values to be quoted when necessary. In addition, dates have to be in YYYY-MM-DD format. Also, you still have to figure out how to get the dsjob script to pass in derived values or values fetched from a table or file, unless you're going to just hardcode them into the script.

Posted: Tue Oct 11, 2005 1:02 pm
by edward_m
Thank you very much.
For now i will hard code parameter values to schedule my sequencer.

You're already 75% done just creating a Batch job and adding your Sequence to it from the drop down. All that's left is to put some lines at the top to open the parameter file, read the lines, and put your values into variables that you'll put into the job control lines where there's currently hardcoded values.
I added this sequencer job in a batch job and created a parmeter file,
could you please give me code for opening file and read the lines and put values into variables.

Please help me.

Posted: Tue Oct 11, 2005 1:31 pm
by kcbland
Use the Search button on this forum. Put ANY of these words into it: OPENSEQ or READSEQ. You will see that numerous people have asked for the exact same help as you. There are plenty of examples, please avail yourself.