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

How to pass a value from a file to PARM parameter


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 7:12 pm
Reply with quote

Hello,

Having a date value in a VSAM file (1,8 - position), Daily it will get updated. On daily basis need to take up this date value ang have to pass
this in to PARM parameter in the JCL. Because with the data, have to
fetch the corressponding Input File.
fyi,

Input File - P.SYSTEM.IIC.DDMMYY - here in DDMMYY - have to pass the
date value whatever entered in to the VSAM file using PARM parameter in the jcl.

Kindly post your reply
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Aug 27, 2008 7:15 pm
Reply with quote

The only way that you can use that value in a batch job is if you create the JCL in one job and submit the job either through INTRDR or by issuing a schedule trigger.

The best way would be for a program to read the value from the VSAM file and use that value within the program.
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 7:21 pm
Reply with quote

expat wrote:

The best way would be for a program to read the value from the VSAM file and use that value within the program.


If we are reading through a COBOL program, how we can recognize the
corresponding file ? By CICS screen we will get the datevalue in to VSAM file. with the Date value I have to take the required file for further process. Suppose the file having "073108" , I have to take july31st Input file. Here we are having the Input file till up to date.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Aug 27, 2008 7:21 pm
Reply with quote

OK.

You have a program that reads the VSAM file and retrieves the date value as required. It then writes this value to a specific member of a PDS in the form of a valid JCL SET statement:

// SET DAT=thedatevalue

Then, that PDS and member are used in the subsequent job via a JCLLIB and an INCLUDE statement:

// JCLLIB ORDER=THE.PDS
// INCLUDE THEMEMBER
...
//STEPXXXX EXEC PGM=XXXX,PARM='&DAT'
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 27, 2008 7:25 pm
Reply with quote

One way to do what you want would be to read the date from the file and create a set statement in a pds member that could be included in your job streams (other then the job reading the file). Of course if DDMMYY is all numeric it won't work.
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 7:34 pm
Reply with quote

Still Im nt clear of this. Sorry to trouble you again.
Normally we will be giving the overrides to SET parameter here, you have given " // SET DAT=thedatevalue " how that date value in the PDS have given to SET DAT=mmddyy. This is an automated process.
In JCLLIB if we are giving the PDS/Dataset how it vl recognize the first
three position is data value ?
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 7:46 pm
Reply with quote

superk wrote:
OK.

You have a program that reads the VSAM file and retrieves the date value as required. It then writes this value to a specific member of a PDS in the form of a valid JCL

can we create a PDS member thru program? and how to validate that as valid for SET statement.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 27, 2008 7:51 pm
Reply with quote

Vasukip,

Quote:
can we create a PDS member thru program? and how to validate that as valid for SET statement.

You can write the entire SET command having the date value to a PDS member using SORT.

Try it out and see what happens.

Thanks,
Arun
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 27, 2008 8:00 pm
Reply with quote

Vasukip,

Quote:
P.SYSTEM.IIC.DDMMYY


Again as Craig suggested, this will not work if you are passing a numeric value to DDMMYY. icon_rolleyes.gif

Thanks,
Arun
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 27, 2008 8:01 pm
Reply with quote

MMDDYY as an all numeric value will not work as a node in an MVS File name!
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 8:02 pm
Reply with quote

Through COBOL pgm I can change that into DDMMMYY , that is not an issue
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 27, 2008 8:06 pm
Reply with quote

Craq Giegerich wrote:
MMDDYY as an all numeric value will not work as a node in an MVS File name!


Just a typo
DDMMYY as an all numeric value will not work as a node in an MVS File name! You can not have an all numeric node in an MVS File name!
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Aug 27, 2008 8:07 pm
Reply with quote

If the value is being used as a PARM then being all numeric will be OK
Code:

// SET     PREFIX='12345678'                           
//*                                                     
//TESTSTEP EXEC PGM=IEFBR14,PARM='&PREFIX'             
IEFC653I SUBSTITUTION JCL - PGM=IEFBR14,PARM='12345678'
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Aug 27, 2008 8:20 pm
Reply with quote

Code:
//TSOVAPA4 JOB (12345),'JCL',CLASS=Q,           
//           MSGCLASS=X,NOTIFY=&SYSUID,         
//           MSGLEVEL=(1,1)                     
//*                                             
//  SET DAT=DATEVALUE                           
//            JCLLIB ORDER=(TSOXXXX.PAS.FORM)   
//STEPLIB INCLUDE MEMBER=DAT                   
//R010     EXEC PGM=SORT,PARM='&DAT'           
//SORTIN DD *                                   
  111 05 ABCD 173                               
  112 02      ABCDE                             
  112 03      123                               
/*                                             
//SORTOUT  DD DSN=TSOXXXX.PAS.OUTPUT.&DAT,     
//           DISP=(NEW,CATLG,DELETE),           
//           UNIT=SYSDA,                       
//           AVGREC=K,                         
//           STORCLAS=CTSDASD,                 


here in the PDS member - 'TSOXXXX.PAS.FORM(DAT)' - the date value is passed as "T082708". The output file got created in TSOXXX.PAS.OUT.DATEVALUE , instead of "TSOXX.PAS.OUT.T082708".
SET command should take that date value "T082708" automatically from the PDS member - DAT.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Aug 27, 2008 8:30 pm
Reply with quote

Vaas,
Code:
//R010     EXEC PGM=SORT,PARM='&DAT'

Why do you want to pass the date value to SORT program?It will not accept whatever you specify in PARM.

From whatever data you have provided so far, You are trying to pass a date value to a program as DDMMYY (all numeric) and within your program you are converting into DDMMMYY to resolve a file-name you want to process further.

expat has provided the solution for the above problem.

If this is not what you are trying to achieve, please explain it more clearly.

Thanks,
Arun
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Thu Aug 28, 2008 10:36 am
Reply with quote

Hi all,

what I was trying to say is need to create a dynamic output file with name of TSOXX.PAS.OUTPUT.&DAT. For this override &DAT - I will be getting the date value as "TDDMMYY" through a file on daily basis, here T just a alphabet because we cudn't create a dataset with numeric after a terminator.
you people have helped me by getting date value in a PDS member.
Eventhough the date value passed to a PDS member, those value is not taken by "SET" command which is referred in the JCL. In the SET - statement we need to provide the datevalue manually. I want that process as a automated one.
Kindly advise to resolve my issue
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Aug 28, 2008 11:36 am
Reply with quote

Your question has been answered, just that you either ignored it or mis understood it.

superk wrote:
OK.

You have a program that reads the VSAM file and retrieves the date value as required. It then writes this value to a specific member of a PDS in the form of a valid JCL SET statement:

// SET DAT=thedatevalue

Then, that PDS and member are used in the subsequent job via a JCLLIB and an INCLUDE statement:

// JCLLIB ORDER=THE.PDS
// INCLUDE THEMEMBER
...
//STEPXXXX EXEC PGM=XXXX,PARM='&DAT'
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 28, 2008 12:06 pm
Reply with quote

Vasukip,

Quote:
you people have helped me by getting date value in a PDS member.
Eventhough the date value passed to a PDS member, those value is not taken by "SET" command which is referred in the JCL

Now your PDS member has nothing but the JCL SET statement along with the date value. Why do you want to enter manually the date value again?

Thanks,
Arun
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Thu Aug 28, 2008 12:13 pm
Reply with quote

Quote:
Now your PDS member has nothing but the JCL SET statement along with the date value. Why do you want to enter manually the date value again?


Hi Arun,
Now my PDS member having Date value as - T070808. This value is not passing to SET command. It got expaned only at INCLUDE member statement. This value is not taken by SET command. I tried one JCL with SET , JCLIB, and INCLUDE MEMBER.
Superk also given SET=datvalue --the PDS member value is not passing here.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top