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

Can I merge the two steps into one?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Jun 25, 2009 1:03 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 25, 2009 8:47 pm
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Jun 25, 2009 9:07 pm
Reply with quote

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.
Code:

32:DATENS(4MD),


Then how can I get the expected answer?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 25, 2009 9:48 pm
Reply with quote

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
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Jun 25, 2009 10:08 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 25, 2009 10:15 pm
Reply with quote

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
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CA7 deleting files in steps after job... CA Products 4
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Merge 2 input files after sort SYNCSORT 14
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top