Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Assigning Filenames using the data from another dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Assigning Filenames using the data from another dataset
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

Site Director


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

PostPosted: Sat May 05, 2007 6:54 pm    Post subject:
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    Post subject: Re: Assigning Filenames
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: 8593
Location: Back in jolly old England

PostPosted: Sat May 05, 2007 10:41 pm    Post subject:
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

Site Director


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

PostPosted: Sun May 06, 2007 1:19 am    Post subject:
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    Post subject: Re: Assigning Filenames using the data from another dataset
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: 8593
Location: Back in jolly old England

PostPosted: Sun May 06, 2007 1:26 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sun May 06, 2007 3:19 pm    Post subject:
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

Site Director


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

PostPosted: Sun May 06, 2007 10:15 pm    Post subject:
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: 30
Location: USA

PostPosted: Mon May 07, 2007 1:31 am    Post subject: Re: Assigning Filenames using the data from another dataset
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us