Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get the value in a file to a JCL variable?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
raghavendra_p_sarvade

New User


Joined: 17 Oct 2006
Posts: 32

PostPosted: Tue May 18, 2010 1:17 am    Post subject: How to get the value in a file to a JCL variable?
Reply with quote

Hi,

I have a simple flat file where I have a date value. I need to get this as a JCL variable for my process.

How can I do it? Thanks!

Thanks,
Raghav
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: Tue May 18, 2010 1:19 am    Post subject:
Reply with quote

Hello,

You need to post an example of what you have as input and what you want as output.

It is likely that the solution will be creating new jcl in "this" process and submitting another. . . This has been discussed several times before.
Back to top
View user's profile Send private message
raghavendra_p_sarvade

New User


Joined: 17 Oct 2006
Posts: 32

PostPosted: Tue May 18, 2010 1:26 am    Post subject: Reply to: How to get the value in a file to a JCL variable?
Reply with quote

//STEP0015 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=USERID1.FILE.NAME,DISP=SHR
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *


Here the file USERID1.FILE.NAME will have only one record with only the date in it.
**********
100517
**********

This value (100517) has to be assigned to a JCL variable (for example S1)
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: Tue May 18, 2010 2:11 am    Post subject:
Reply with quote

Hello,

Yup, in the first process read the date and generate new jcl with the value in it. Then submit the new jcl which now has the needed value.

Do you really want to copy this "date file" to another just like it? Why? If you won't post the actual requirement, you will not get useful replies. . .
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue May 18, 2010 2:25 am    Post subject: Reply to: How to get the value in a file to a JCL variable?
Reply with quote

And didn't we already go over this scenario here?
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: Tue May 18, 2010 2:40 am    Post subject: Reply to: How to get the value in a file to a JCL variable?
Reply with quote

Hi Kevin,

Good catch icon_smile.gif

I guess to some it is ok to waste everyone's time asking the same thing over and over. . .

Who knows, maybe IBM might have changed how things work recently. . . icon_confused.gif

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 18, 2010 2:46 am    Post subject:
Reply with quote

Raghav,

Can you show more details. What will the JCL that will use the S1 variable look like? Is it another sort step or something else? Please elaborate.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue May 18, 2010 2:47 am    Post subject: Reply to: How to get the value in a file to a JCL variable?
Reply with quote

You take the value from the file, USERID1.FILE.NAME, and write it into a member of a PDS in the correct format, such as:

Code:

SYSX       PROD.PDS(CURRDATE) - 01.00                     Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 // SET DATE=100517                                                     
****** **************************** Bottom of Data ****************************


so that now you can use that PDS in any subsequent jobs and have that value for the variable, such as:

Code:
//JOB2 JOB (......)
//*
// JCLLIB ORDER=PROD.PDS
// INCLUDE CURRDATE
//*
...
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Tue May 18, 2010 5:04 pm    Post subject:
Reply with quote

Some installations frown on INCLUDEing a member that is not maintained thru change control.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us