|
View previous topic :: View next topic
|
| Author |
Message |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
 |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
 |
GaganGarg
Active User

Joined: 31 Mar 2010 Posts: 134 Location: India
|
|
|
|
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.  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|