Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to pass the value of a variable in the control cards

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Fri Jun 04, 2010 6:29 pm    Post subject: How to pass the value of a variable in the control cards
Reply with quote

Hi,

I am using the following JCL:

Code:

//JOB1234  JOB (TEST,3),'TESTING JOB',                                 
//            CLASS=7,
//            MSGCLASS=K,MSGLEVEL=(1,1),
//            REGION=0M
//*
//**********************************************************************
//* %%SET %%PFDATE = %%$CALCDTE %%$ODATE +1                            *
//**********************************************************************
//*
//ICETOOL  EXEC PGM=ICETOOL
//IN       DD DSN=OPERA12.PROD.SCAN.VSAM,                                 
//            DISP=SHR                                                 
//TEMP     DD DSN=OPERA12.PROD.EXTRACT.BSAM,       
//         DISP=SHR                                             
//TOOLIN   DD *                                                         
  COPY FROM(IN) TO(TEMP) USING(CTL1)                                   
/*                                                                     
//CTL1CNTL DD *                                                         
  OMIT COND=(31,1,CH,EQ,C'A',AND,21,10,CH,LT,DATE1(-))                 
  SORT FIELDS=(1,31,CH,A)                                               
  OUTREC BUILD=(1,31)                                                   
/*                                                                     
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//*
//**********************************************************************
//* PROC123                                                            *
//**********************************************************************
//*
//PROC123  EXEC PROC123
//PGM123.SYSIN DD *               
%%PFDATE                           
/*                                 


This JCL works fine in production. PFDATE is calculated from the SCHEDULAR's date (ODATE). i want to use PFDATE instead of DATE1(-). Format of PFDATE is YYYYMMDD. can anybody please tell me how to use this variable in the control card? i will be very thankful.
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Fri Jun 04, 2010 6:44 pm    Post subject: Reply to: Hoe to pass the value of a variable in the control
Reply with quote

You need a program that can accept the variable PFDATE as a parameter, i.e.:

//STEPNAME EXEC PGM=PGMX,PARM='&PFDATE'
//OUT DD DSN=&&S1,DISP=(,PASS),...

and write that value as a DFSORT symbolic name, referenced in your SORT/ICETOOL step by the SYMNAMES DD statement. something like:

//SYMNAMES DD DSN=&&S1,DISP=(OLD,DELETE),...

where &&S1 contains something like this:

PFDATE,C'20100604'

and your control parameters:

OMIT COND=(31,1,CH,EQ,C'A',AND,21,10,CH,LT,PFDATE)
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat Jun 05, 2010 3:21 pm    Post subject:
Reply with quote

Hi,

I'm not sure I understand the question,

do you want the %%PFDATE in the SORT control card in the format of
YYYY-MM-DD ?

You will be running this thru Control-M ?


Gerry
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Mon Jun 07, 2010 8:56 am    Post subject:
Reply with quote

Yes Gerry, you got it right. Can you please tell the syntax. i can't run it in test region as in our test region, jobs can't be scheduled. onsite will be running the job in production.

I used the SYMNAMES as below:

Code:

//JOB1234  JOB (TEST,3),'TESTING JOB',                                 
//            CLASS=7,
//            MSGCLASS=K,MSGLEVEL=(1,1),
//            REGION=0M
//*
//**********************************************************************
//* %%SET %%PFDATE = %%$CALCDTE %%$ODATE +1                            *
//**********************************************************************
//*
//ICETL01  EXEC PGM=ICETOOL     
//SYMNAMES DD *                     
  TESTDT,C'PFDATE'             
/*                             
//TOOLMSG  DD SYSOUT=*         
//DFSMSG   DD SYSOUT=*         
//IN       DD DSN=OPERA12.PROD.SCAN.VSAM,                                 
//            DISP=SHR                                                 
//TEMP     DD DSN=OPERA12.PROD.EXTRACT.BSAM,       
//         DISP=SHR                                             
//TOOLIN   DD *                                                         
  COPY FROM(IN) TO(TEMP) USING(CTL1)                                   
/*                                                                     
//CTL1CNTL DD *                                                         
  OMIT COND=(31,1,CH,EQ,C'A',AND,21,10,CH,LT,TESTDT)                 
  SORT FIELDS=(1,31,CH,A)                                               
  OUTREC BUILD=(1,31)                                                   
/*                                                                     
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//*
//**********************************************************************
//* PROC123                                                            *
//**********************************************************************
//*
//PROC123  EXEC PROC123
//PGM123.SYSIN DD *               
%%PFDATE                           
/*


but i am not sure whether it will work or not as i already mentioned i could not test it in test region. please provide your valuable suggestions. I will be very thankful to you.

Thanks
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: Mon Jun 07, 2010 9:20 am    Post subject:
Reply with quote

Hello,

Possibly there is something i misunderstand. . .

Why can this not be tested using
Code:
// SET variablename=value


Maybe start here:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/iea2b690/25.0
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Jun 07, 2010 9:42 am    Post subject:
Reply with quote

Hi,

you have don't have to run the job to simulate the results.

This is one way of getting the date in the format of YYYY-MM-DD
Code:
//* %%SET %%PFDATE = %%$CALCDTE %%$ODATE +1     
//* %%SET %%PFYYYY = %%SUBSTR %%PFDATE 1 4     
//* %%SET %%PFMM   = %%SUBSTR %%PFDATE 5 2     
//* %%SET %%PFDD   = %%SUBSTR %%PFDATE 7 2     


Code:
  OMIT COND=(31,1,CH,EQ,C'A',AND,                     
             21,10,CH,LT,C'%%PFYYYY-%%PFMM-%%PFDD')   


Gerry
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 134
Location: India

PostPosted: Mon Jun 07, 2010 5:35 pm    Post subject:
Reply with quote

Thanks a lot Gerry. This is what i needed. I am new in writing this type of JCL using CONTROL-M variables. Thanks a lot for the much needed help. icon_smile.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us