View previous topic :: View next topic
|
Author |
Message |
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
Hi All,
i have a requirment in which i want to assign the dataset names in the JCL by reading first record of another Dataset.
To Elaborate:
I have a dataset which will have some records.
i need to read the first record , pick up the first 8 bytes and use that as one of Qualifer for my dataset name.
Say my file have the records like:
USabcdef12456789
ANpoiuyw14578954
JMpoiuier14578936
i need to pick up the first 8 bytes of the first record and use it for naming my datasets:
so my dataset name would look like
HLQ1.USabcdef.Input
HLQ1.USabcdef.Output
Please let me know how we can achieve the same.
Any idea for this would be highly appreciated. :) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
One way to do what you want is to read your external file into a program and have that program write the "run" jcl through the internal reader with the dsn changes that you want. |
|
Back to top |
|
|
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
thanks for a quick response Dick.
Can you please elaborate on the process. A code snippet might be more helpful to understand. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You certainly can not amend the JCL of the current job, so any dataset that is named by this method would have to be in a new job, submitted from the one currently executing.
You can use ISPF file tailoring, or just build the JCL in program and submit it through the INTRDR.
To be honest, neither way appeals to me because having such varible names in the JCL does make it far more difficult to connect a given dataset to a give njob on a given day.
In my view, GDG is a far easier solution and needs no fancy programs to generate JCL. I hope this isn't scheduled to be a production job. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello IHSugar,
This DD statement is the only "code" snippet i can think of:
Code: |
//ddname DD SYSOUT=(x,INTRDR) |
where x is the class used at your location (i've seen *, A, or a digit at various sites).
To write to this dd, define an 80-byte file in your program and write to it. SORT, IEBGEBER, and any other utility can also write to INTRDR. |
|
Back to top |
|
|
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
Thanks for the quick response.
ya it might be difficult to trace the filenames for the day but thats how business wants it. So i have to bide by the requirment and the code has to go in production.
Is it safe to create a run JCL in the code and then use it.
Waiting for your worthy comments.
Thanks expat & dick |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Not possible to use a schedule package to identify the dataset with the run date instead ? |
|
Back to top |
|
|
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
The Business actually wants the filenames to contain the information about their customer,so those first eight bytes will represent the customer for whom the file was run... Using date wont help much...
Can i do the same using Rexx.. read the dataset and pass the variable to job?? is it possible, if yes , how to pass it to job?? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can, but you will have to submit a job from the REXX as you are not able to change the JCL once it has been interpreted by JES. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Using the internal reader is quite safe.
If incorrect jcl is submitted via the internal reader, errors occur. They also occur if a cataloged procedure or jcl submitted by scheduling software is incorrect.
Personally, i prefer using the scheduling software, but have used the internal reader many times when the conditions were such that existing setup was very error prone due to convoluted setup rules (it is still a surprise to see what some operations departments must deal with) or the setup was data dependent. |
|
Back to top |
|
|
timburkart
New User
Joined: 17 Mar 2007 Posts: 29 Location: USA
|
|
|
|
Dear IHSugar:
If the first 8 bytes of the first record refer to the customer id, what do the second and subsequent records look like?
Is the data of this file for only one customer?
How is the file created?
How many customers are there (approximately)?
regards,
tim |
|
Back to top |
|
|
|