Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using Symbolic parameters in SET statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Using Symbolic parameters in SET statement
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: 1789
Location: Bloomington, IL

PostPosted: Tue Dec 04, 2012 10:42 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Tue Dec 04, 2012 10:46 pm    Post subject: Reply to: Using Symbolic parameters in SET statement
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    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 471
Location: London

PostPosted: Wed Dec 05, 2012 7:07 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Dec 05, 2012 7:22 pm    Post subject: Re: Using Symbolic parameters in SET statement
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    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 471
Location: London

PostPosted: Wed Dec 05, 2012 9:01 pm    Post subject:
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
http://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    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 Usage of Like statement in PL/I Sakthidevi PL/I & Assembler 3 Fri Nov 15, 2019 11:22 pm
No new posts COBOL -DB2 SQL code to have GROUP BY ... vinu78 DB2 21 Wed Oct 23, 2019 7:00 pm
No new posts Can we pass the value of Symbolic par... Poha Eater JCL & VSAM 5 Thu Sep 05, 2019 2:21 pm
No new posts SQLCODE -950 in PREPARE statement ... PeD DB2 2 Sat Apr 20, 2019 7:00 pm
No new posts File data to symbolic parameter madprasy JCL & VSAM 5 Wed Mar 13, 2019 11:14 am

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