IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Assigning Filenames using the data from another dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Sat May 05, 2007 6:48 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 05, 2007 6:54 pm
Reply with quote

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
View user's profile Send private message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Sat May 05, 2007 7:01 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 05, 2007 10:41 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 06, 2007 1:19 am
Reply with quote

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
View user's profile Send private message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Sun May 06, 2007 11:25 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun May 06, 2007 1:26 pm
Reply with quote

Not possible to use a schedule package to identify the dataset with the run date instead ?
Back to top
View user's profile Send private message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Sun May 06, 2007 2:51 pm
Reply with quote

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?? icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun May 06, 2007 3:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 06, 2007 10:15 pm
Reply with quote

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
View user's profile Send private message
timburkart

New User


Joined: 17 Mar 2007
Posts: 29
Location: USA

PostPosted: Mon May 07, 2007 1:31 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top