View previous topic :: View next topic
Author
Message
dejunzhu Active User Joined: 08 May 2008Posts: 390 Location: China
hi, now I have the following job, which is composed of two steps.
Is there anyway to use just one step to achieve the same function?
Code:
//*------------------------------------------------------------------
//*STEP1: DELETE THE HEADER BEFORE DATA PROCESSING ----------------
//*------------------------------------------------------------------
//PREPARE EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DISP=SHR,DSN=EV6954.RDC.LIST01
//OUT DD DISP=(,PASS),DSN=&&RDCLIST,
// SPACE=(CYL,(50,10),RLSE),
// DCB=RECFM=FB
//TOOLIN DD *
*REMOVE FIRST HEADER RECORD
SUBSET FROM(IN) TO(OUT) INPUT REMOVE HEADER
//CTL1CNTL DD *
*SORT THE DETAIL RECORDS BY CUSTOMER#
SORT FIELDS=(1,6,CH,A)
/*
//*------------------------------------------------------------------
//*STEP2: DATA PROCESSING STARTS
//*------------------------------------------------------------------
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=&&RDCLIST,DISP=(OLD,DELETE)
//FILEA DD DSN=EV6954.RDC.TOCHG,DISP=(,CATLG),
// UNIT=3390,VOL=SER=BFF233,
// SPACE=(CYL,(50,10),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=)
//SORTOUT DD DSN=EV6954.BDW.RDC.LIST,DISP=(,CATLG),
// UNIT=3390,VOL=SER=BFF233,
// SPACE=(CYL,(50,10),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=)
//SYSIN DD *
INREC PARSE=(%00=(ENDBEFR=X'05',FIXLEN=6),
%01=(ENDBEFR=X'05',FIXLEN=1),
%02=(ENDBEFR=X'05',FIXLEN=7),
%03=(ENDBEFR=X'05',FIXLEN=1),
%04=(ENDBEFR=X'05',FIXLEN=7),
%05=(ENDBEFR=X'05',FIXLEN=2),
%06=(ENDBEFR=X'05',FIXLEN=7),
%07=(ENDBEFR=X'05',FIXLEN=1),
%08=(ENDBEFR=BLANKS,FIXLEN=2)),
BUILD=(1:%00,
7:%01,
8:%02,
15:%03,
16:%04,
23:%05,
25:%06,
32:C'090518',
38:%07,
39:%08,
41:40X)
SORT FIELDS=COPY
SUM FIELDS=NONE
OUTREC OVERLAY=(15:15,2,CHANGE=(2,C' ',C'--'),NOMATCH=(15,2),
38:38,1,CHANGE=(1,C' ',C'-'),NOMATCH=(38,1))
OUTFIL FNAMES=FILEA,INCLUDE=(25,6,SS,NE,C' ')
OUTFIL FNAMES=SORTOUT,INCLUDE=(25,6,SS,EQ,C' '),
OUTREC=(1,29,32,9,42X)
/*
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You didn't show an example of the input records, so I can't say for sure, but if the key in positions 1-6 after the INREC can be used as the sort key, you can use this one step:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=A
//SORTIN DD DISP=SHR,DSN=EV6954.RDC.LIST01
//FILEA DD DSN=EV6954.RDC.TOCHG,DISP=(,CATLG),
// UNIT=3390,VOL=SER=BFF233,
// SPACE=(CYL,(50,10),RLSE)
//SORTOUT DD DSN=EV6954.BDW.RDC.LIST,DISP=(,CATLG),
// UNIT=3390,VOL=SER=BFF233,
// SPACE=(CYL,(50,10),RLSE)
//SYSIN DD *
OPTION SKIPREC=1
INREC PARSE=(%00=(ENDBEFR=X'05',FIXLEN=6),
%01=(ENDBEFR=X'05',FIXLEN=1),
%02=(ENDBEFR=X'05',FIXLEN=7),
%03=(ENDBEFR=X'05',FIXLEN=1),
%04=(ENDBEFR=X'05',FIXLEN=7),
%05=(ENDBEFR=X'05',FIXLEN=2),
%06=(ENDBEFR=X'05',FIXLEN=7),
%07=(ENDBEFR=X'05',FIXLEN=1),
%08=(ENDBEFR=BLANKS,FIXLEN=2)),
BUILD=(1:%00,
7:%01,
8:%02,
15:%03,
16:%04,
23:%05,
25:%06,
32:C'090518',
38:%07,
39:%08,
41:40X)
SORT FIELDS=(1,6,CH,A)
SUM FIELDS=NONE
OUTREC OVERLAY=(15:15,2,CHANGE=(2,C' ',C'--'),NOMATCH=(15,2),
38:38,1,CHANGE=(1,C' ',C'-'),NOMATCH=(38,1))
OUTFIL FNAMES=FILEA,INCLUDE=(25,6,SS,NE,C' ')
OUTFIL FNAMES=SORTOUT,INCLUDE=(25,6,SS,EQ,C' '),
OUTREC=(1,29,32,9,42X)
/*
Back to top
dejunzhu Active User Joined: 08 May 2008Posts: 390 Location: China
Yes, Thanks Frank Yaeger.
The method you provided is effective.
Thank you.
But in the above JCL control statements,
I want to substitute C'090516' with current date(now, 090625, for example),
I looked into the manual, and found DATENS(4MD) can do this.
But how can I realize it?
I tired to use the following statement directly, but failed.
Then how can I get the expected answer?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
I suspect you have z/OS DFSORT V1R5 and need to use DATENS=(abc) instead of DATENS(abc).
Since you say you want a C'090626' date, you would use DATENS=(YMD).
Y gives a 2-digit year date whereas 4 gives a 4-digit year date.
For z/OS DFSORT V1R10, you can use DATENS(abc) or DATENS=(abc).
For z/OS DFSORT V1R5, you must use DATENS=(abc).
Back to top
dejunzhu Active User Joined: 08 May 2008Posts: 390 Location: China
But I tried both, and still did not works.
According to the manual, it seems that DATENS=(abc) must be used along with HEADER/TAILER.
But I want the date to be appear neither in the header nor in the tailer, instead, I want it appear in the detail record.
Can you give me some solutions ?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
DATENS=(abc) has been allowed in BUILD since 2004! If you can't use it in BUILD, then your site is really behind in applying DFSORT service. Ask your System Programmer to install z/OS DFSORT V1R5 PTF UK90013 (July, 2008). That will get you all of the latest DFSORT/ICETOOL functions.
Alternatively, you could use DATE1 to get a 'yyyymmdd' date. DATE1 was available in BUILD long before DATENS was.
Quote:
According to the manual, it seems that DATENS=(abc) must be used along with HEADER/TAILER.
You must be looking at an old manual. For the latest DFSORT books, see:
Use [URL] BBCode for External Links
Back to top
Please enable JavaScript!