Scheduling Sequencer

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
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Scheduling Sequencer

Post 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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post by edward_m »

KCBLAND,

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

Thnaks
khanparwaz
Participant
Posts: 60
Joined: Tue Jul 12, 2005 3:34 am

Post by khanparwaz »

Try utilityrunjob utility to pass parameters.

Khan
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That looks familiar. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post 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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post 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.
ucf007
Charter Member
Charter Member
Posts: 18
Joined: Fri Feb 27, 2004 2:25 pm

Post by ucf007 »

use the option -param ...
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post 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?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
edward_m
Charter Member
Charter Member
Posts: 257
Joined: Fri Jun 24, 2005 9:34 am
Location: Philadelphia,PA

Post 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.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply