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

Using Symbolic parameters in SET statement


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Tue Dec 04, 2012 10:27 pm
Reply with quote

Hi , I recently came to know that we can use sysmbolic parameters in SET statements
to get DATE , DAY , TIME etc...

I tried the below jcl step

Code:
// SET DATE=D&YYMMDD.                             
//IEFBR14 EXEC PGM=IEFBR14                       
//NEWDS   DD   DSN=MAGT.&DATE..CNTL,DISP=(,CATLG),
// SPACE=(TRK,(1,1,1)),BLKSIZE=0,LRECL=80   


and MAGT.D121204.CNTL is created.When I tried to get the day (tuesday)
I am getting JCL error.Here is my jcl for DAY

Code:
// SET DAY=D&ZDAY.                               
//IEFBR14 EXEC PGM=IEFBR14                       
//NEWDS   DD   DSN=MAGT.&DAY..CNTL,DISP=(,CATLG),
// SPACE=(TRK,(1,1,1)),BLKSIZE=0,LRECL=80   


What is wrong with this?? also please let me know the list of parameters like this ( ZJOBID, ZJOBNAME).Please help.

Previously i used internal reader to get this type of data.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Dec 04, 2012 10:42 pm
Reply with quote

You appear to be confusing JCL symbolics with ISPF system variables.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Dec 04, 2012 10:46 pm
Reply with quote

You have to show what error you got. Did you mean &WDAY?
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 Dec 05, 2012 1:53 am
Reply with quote

Why do you have a period at the end of the SETs
"// SET DATE=D&YYMMDD."and "// SET DAY=D&ZDAY." ?
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 582
Location: London

PostPosted: Wed Dec 05, 2012 7:07 pm
Reply with quote

Use REXX or suchlike to generate into a PDS member the JCL with the SET statements

e.g.

generate these statements into PDS.MEMBER.LIB(@RUNDATE) with the REXX which can get the date and time..

// SET RUNDATE=11318
// SET RUNTIME=1638


then in the execution JCL..reference it as follows using the INCLUDE

//JCL JCLLIB ORDER=(PDS.MEMBER.LIB)
// INCLUDE MEMBER=@RUNDATE
//X DD DSN=FILE.NAME.D&RUNDATE..T&RUNTIME,
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Dec 05, 2012 7:22 pm
Reply with quote

Arunkumar Chandrasekaran wrote:
Code:
// SET DATE=D&YYMMDD.                             
//IEFBR14 EXEC PGM=IEFBR14                       
//NEWDS   DD   DSN=MAGT.&DATE..CNTL,DISP=(,CATLG),
// SPACE=(TRK,(1,1,1)),BLKSIZE=0,LRECL=80   


and MAGT.D121204.CNTL is created.
did this work for you?

As it did not work for me, I get this error:
Code:
STMT NO. MESSAGE                                             
       4 IEFC627I INCORRECT USE OF AMPERSAND IN THE DSN FIELD


I'm not sure but it sounds like I should suggest you to read about EZACFSM1 instead. icon_rolleyes.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Dec 05, 2012 7:34 pm
Reply with quote

There are some envirnment where JCL like what Arunkumar has shown is sent to other parser which replaces these variables with value and then submits it.

Could be similar case...
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 582
Location: London

PostPosted: Wed Dec 05, 2012 9:01 pm
Reply with quote

helps if you include the relevent messages. I tried this and get the following (as expected).You can clearly see in the substitution JCL that no date value is being passed. Still the same if set value is in quotes which it has to be when you have special characters like the & in it.

Give up and use the example I provided. System symbols can only be used in started task JCL
publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.ieab600/symparm.htm

IEFC653I SUBSTITUTION JCL - DSN=FILE.NAME.D&YYMMDD.TEST,DISP=(,CATLG),SPACE=(TRK,(1,1)),BLKSIZE=0,LRECL=80
STMT NO. MESSAGE
4 IEFC627I INCORRECT USE OF AMPERSAND IN THE DSN FIELD
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 Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Injecting HTTPHEADER parameters in th... PL/I & Assembler 0
No new posts pass data as symbolic parameter from ... CLIST & REXX 2
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
Search our Forums:

Back to Top