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

How to get the value in a file to a JCL variable?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue May 18, 2010 1:19 am
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
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

Moderator Emeritus


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

PostPosted: Tue May 18, 2010 2:11 am
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

Global Moderator


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

PostPosted: Tue May 18, 2010 2:25 am
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

Moderator Emeritus


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

PostPosted: Tue May 18, 2010 2:40 am
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 Developer


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

PostPosted: Tue May 18, 2010 2:46 am
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

Global Moderator


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

PostPosted: Tue May 18, 2010 2:47 am
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

Senior Member


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

PostPosted: Tue May 18, 2010 5:04 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top