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

Can we do the following JCL in one step using DFSORT/ICETOOL


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

New User


Joined: 02 Jun 2006
Posts: 6

PostPosted: Thu Oct 18, 2007 3:13 am
Reply with quote

I have a below requirement.
My input file has records Lrecl=80.
Can we do the following JCL in one step.
If not, may be first two step
Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN    DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
GGG          11111112         5CD200201B000000000000000 000000000239913
GGG          11111112         BO0200201B000000000139913 000000000000000
GGG          11111112         C10200201B000000000100000 000000000000000
GGG          11111112         5CD200202B000000000000000 000000000362915
GGG          11111112         BO0200202B000000000162915 000000000000000
GGG          11111112         C10200202B000000000100000 000000000000000
GGG          11111112         H40200202B000000000100000 000000000000000
GGG          11111112         5CD200203B000000000000000 000000005995929-
GGG          11111112         BO0200203B000000005995929-000000000000000
GGG          11111112         5CD200204B000000000000000 000000000945346
GGG          11111112         BO0200204B000000000145346 000000000000000
GGG          11111112         C10200204B000000000800000 000000000000000
//*                              upto12(dec)
/*
//SORTOUT   DD DSN=OUTPUT.TEMP,
//*         DCB=(DCBLABEL,RECFM=FB,LRECL=271,BLKSIZE=0)
//SYSIN    DD *
 SORT FIELDS=(14,20,CH,A)
 INREC OVERLAY=(31:31,3,CHANGE=(3,C'5CD',C'999'),
 NOMATCH=(31,3))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN    DD  DSN=OUTPUT.TEMP,DISP=SHR
//SORTOUT   DD DSN=OUTPUT.TEMP.OK,
//*         DCB=(DCBLABEL,RECFM=FB,LRECL=271,BLKSIZE=0)
//SYSIN    DD *
 OPTION COPY
 INREC OVERLAY=(31:31,3,CHANGE=(3,C'999',C'5CD'),
 NOMATCH=(31,3))
/*
//PS010   EXEC PGM=COBOL
//*--------------------------------------------------------------
//FCSIN    DD  DSN=OUTPUT.TEMP.OK,
//             DISP=SHR
//FCSOUT   DD  DSN=OUTPUT.test.file
//             DCB=(DCBLABEL,RECFM=FB,LRECL=271,BLKSIZE=0)


Output file

GGG   AAAA        CCCC   YEAR   B   JAN    FEB     MAR     APR    TOTAL
---     --------        ----    ----    -       ------  ------  -------- ------ -----
GGG   11111112   BO0   2002   B   139913   162915   -5995929 145346   
GGG   11111112   C10   2002   B   100000   100000          0 800000   
GGG   11111112   H40   2002   B        0   100000          0      0   
GGG   11111112   5CD   2002   B   239913   362915   -5995929 945346   -4447755

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 Oct 18, 2007 4:28 am
Reply with quote

It looks like your first two steps ensure that '5CD' sorts last even if you have a higher value like '888' (which you don't in your example). If so, you can do that in one step like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN    DD DSN=...  input file
//SORTOUT   DD DSN=...  output file
//SYSIN DD *
  INREC IFTHEN=(WHEN=(31,3,CH,EQ,C'5CD'),OVERLAY=(31:C'999'))
  SORT FIELDS=(14,20,CH,A)
  OUTREC IFTHEN=(WHEN=(31,3,CH,EQ,C'999'),OVERLAY=(31:C'5CD'))
/*


In the future, please explain what you're trying to do in detail so we don't have to guess.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top