pass a parametersthrough file
Moderators: chulett, rschirm, roy
pass a parametersthrough file
Hi,
in job sequence while running 100 jobs together, one way to give default value in parameter ok.....
the other way??????????????
is there any way like....................
enter all the parameter and its value that we using in the project written in a txt file
then call the txt file in the job seq......
when ever the parameter occur in J.Seq then the vaue of the parameter is taken from the file
is there any way in this format....
and how to implement this logic....
ie how to call the txt file in job seq..
in job sequence while running 100 jobs together, one way to give default value in parameter ok.....
the other way??????????????
is there any way like....................
enter all the parameter and its value that we using in the project written in a txt file
then call the txt file in the job seq......
when ever the parameter occur in J.Seq then the vaue of the parameter is taken from the file
is there any way in this format....
and how to implement this logic....
ie how to call the txt file in job seq..
D.N .MURTHY
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
1. Learn DataStage BASIC programming language.
2. Create new server job, open job properties, enter job control code on Job Control tab. Save and compile.
Easy.
2. Create new server job, open job properties, enter job control code on Job Control tab. Save and compile.
Easy.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi,
I hope the code below can help you.
Reading Parameters from a Parameter File
The Below mentioned code illustrates how to read the following parameters from a parameter hashed file and log information about the directory paths in the log:
- DIM_DSN
- DIM_UID
- DIM_PWD
- STG_DSN
- STG_UID
- STG_PWD
- EDW_DSN
- EDW_UID
- EDW_PWD
Code:
OPEN "STG_Parameters_Hash_File" TO PARAMFILE
ELSE
Call DSLogFatal("Job Failed: Unable To Open Hashed File", "JobControl")
END
READ PARAMREC FROM PARAMFILE , "DIM_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "DIM_UID"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "DIM_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_UID"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
EDW_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_UID"
ELSE
Call DSLogFatal ("Job Failed: Unable To read Record from Hashed File", "JobControl")
END
EDW_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
EDW_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "ROOT_DIR"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
ROOTDIR = PARAMREC<1>
CLOSE PARAMFILE
-- Assigning Values to Directories
InputDirectory = ROOTDIR: "\Input\PrimarySales\"
InProcessDirectory = ROOTDIR: "\Inprocess\PrimarySales\"
ErrorDirectory = ROOTDIR: "\Error\PrimarySales\"
ReProcessDirectory = ROOTDIR: "\Reprocess\PrimarySales\"
ProcessedDirectory = ROOTDIR: "\Processed\PrimarySales\"
ControlFilesDirectory = ROOTDIR: "\ControlFiles\PrimarySales\"
-- Logging the Directory Path
Call DSLogInfo("Input Dir: ": InputDirectory,"JobParameter")
Call DSLogInfo("Inprocess Dir: ": InProcessDirectory,"JobParameter")
Call DSLogInfo("Error Dir: ": ErrorDirectory,"JobParameter")
Call DSLogInfo("ReProcess Dir: ": ReProcessDirectory,"JobParameter")
Call DSLogInfo("Processed Dir: ": ProcessedDirectory,"JobParameter")
Call DSLogInfo("ControlFiles Dir: ": ControlFilesDirectory,"JobParameter")
Note: You need to write parameters to a hashed file before you start this excercise.
Sai
I hope the code below can help you.
Reading Parameters from a Parameter File
The Below mentioned code illustrates how to read the following parameters from a parameter hashed file and log information about the directory paths in the log:
- DIM_DSN
- DIM_UID
- DIM_PWD
- STG_DSN
- STG_UID
- STG_PWD
- EDW_DSN
- EDW_UID
- EDW_PWD
Code:
OPEN "STG_Parameters_Hash_File" TO PARAMFILE
ELSE
Call DSLogFatal("Job Failed: Unable To Open Hashed File", "JobControl")
END
READ PARAMREC FROM PARAMFILE , "DIM_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "DIM_UID"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "DIM_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
DIM_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_UID"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "STG_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
STG_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_DSN"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
EDW_DSN = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_UID"
ELSE
Call DSLogFatal ("Job Failed: Unable To read Record from Hashed File", "JobControl")
END
EDW_UID = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "EDW_PWD"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
EDW_PWD = PARAMREC<1>
READ PARAMREC FROM PARAMFILE , "ROOT_DIR"
ELSE
Call DSLogFatal("Job Failed: Unable To read Record From Hashed File", "JobControl")
END
ROOTDIR = PARAMREC<1>
CLOSE PARAMFILE
-- Assigning Values to Directories
InputDirectory = ROOTDIR: "\Input\PrimarySales\"
InProcessDirectory = ROOTDIR: "\Inprocess\PrimarySales\"
ErrorDirectory = ROOTDIR: "\Error\PrimarySales\"
ReProcessDirectory = ROOTDIR: "\Reprocess\PrimarySales\"
ProcessedDirectory = ROOTDIR: "\Processed\PrimarySales\"
ControlFilesDirectory = ROOTDIR: "\ControlFiles\PrimarySales\"
-- Logging the Directory Path
Call DSLogInfo("Input Dir: ": InputDirectory,"JobParameter")
Call DSLogInfo("Inprocess Dir: ": InProcessDirectory,"JobParameter")
Call DSLogInfo("Error Dir: ": ErrorDirectory,"JobParameter")
Call DSLogInfo("ReProcess Dir: ": ReProcessDirectory,"JobParameter")
Call DSLogInfo("Processed Dir: ": ProcessedDirectory,"JobParameter")
Call DSLogInfo("ControlFiles Dir: ": ControlFilesDirectory,"JobParameter")
Note: You need to write parameters to a hashed file before you start this excercise.
Sai
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hi saikir,
And I created one hashed file with the parameters. When I run the Batch job, it is giving the error like,
"BATCH_CALL_PARAMS_FROM_HASH..JobControl (fatal error from JobControl): Job Failed: Unable To Open Hashed File"
Can you please give some brief description about the code. How to use it and how to call the hashed file into the job control and how to pass these parameters to a job?
Thanks in advance.
I have written the query given by you in Job control and added one job in the same job control of batchjob at the end of the code.The Below mentioned code illustrates how to read the following parameters from a parameter hashed file and log information about the directory paths in the log:
And I created one hashed file with the parameters. When I run the Batch job, it is giving the error like,
"BATCH_CALL_PARAMS_FROM_HASH..JobControl (fatal error from JobControl): Job Failed: Unable To Open Hashed File"
Can you please give some brief description about the code. How to use it and how to call the hashed file into the job control and how to pass these parameters to a job?
Thanks in advance.
Ravi
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
Enter GetParameterFromFile into the search. I think it's the 2nd item returned. Here's a linkviewtopic.php?t=107451&highlight=GetParameterFromFile
This addresses one method to pass Job Parameters through a flat file.
Another way is, of course, to upgrade to v8 :D
Good Luck,
Tony
This addresses one method to pass Job Parameters through a flat file.
Another way is, of course, to upgrade to v8 :D
Good Luck,
Tony
Hi Ray,
Thanks for your reply.
I already created a hashed file STG_Parameters_Hash_File with all the reqired parameters, but
I don't understand the other thing you have mentioned that we need to have a VOC pointer to it.
Can you please tell me how to get or define that VOC ponter?
Thanks in advance
Tony,
Thanks for your reply, and I will go through your comments and let you know the result.
Thanks for your reply.
I already created a hashed file STG_Parameters_Hash_File with all the reqired parameters, but
I don't understand the other thing you have mentioned that we need to have a VOC pointer to it.
Can you please tell me how to get or define that VOC ponter?
Thanks in advance
Tony,
Thanks for your reply, and I will go through your comments and let you know the result.
Ravi