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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Jun 04, 2010 6:44 pm
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: 1702
Location: Australia

PostPosted: Sat Jun 05, 2010 3:21 pm
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
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

Moderator Emeritus


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

PostPosted: Mon Jun 07, 2010 9:20 am
Reply with quote

Hello,

Possibly there is something i misunderstand. . .

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


Maybe start here:
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: 1702
Location: Australia

PostPosted: Mon Jun 07, 2010 9:42 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top