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
 

 

Can I merge the two steps into one?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can I merge the two steps into one?
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 Moderator


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

PostPosted: Thu Jun 25, 2009 8:47 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Jun 25, 2009 9:48 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Jun 25, 2009 10:15 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html
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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts SQL Merge error -254 Robin Sulsona DB2 8 Wed Jun 01, 2016 8:28 pm
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm
No new posts SAS MERGE to DFSORT Musab Ahmed DFSORT/ICETOOL 6 Mon Feb 01, 2016 5:44 pm


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