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

Please help me in SORT


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

New User


Joined: 15 May 2008
Posts: 4
Location: Chennai

PostPosted: Tue Nov 03, 2009 5:07 pm
Reply with quote

Hi... My requirement is to create an output file in the following format.

Date : 11/03/2009
Count : XXXXXXXXX

Input file will have date at the very first record (position 60 to 67 - CCYYMMDD format).
i.e first record will be date record and remaining records are detail recs. I need the date and count of detail recs in the above format.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Nov 03, 2009 6:25 pm
Reply with quote

Hi ,
below step will give you desired output.
Assumed input and output LRECL=80.


Code:

//S1   EXEC  PGM=ICETOOL                                       
//TOOLMSG   DD  SYSOUT=*                                       
//DFSMSG    DD  SYSOUT=*                                       
//IN1  DD DSN=your input dataset
//OUT   DD  DSN=outputdatasetname,DISP=(MOD,CATLG,DELETE),   
//         LRECL=80                                           
//TOOLIN DD *                                                 
  SUBSET FROM(IN1) TO(OUT) KEEP INPUT FIRST USING(CTL1)       
  COUNT FROM(IN1) WRITE(OUT) TEXT('COUNT:') DIGITS(9) WIDTH(80) SUB(1)
/*                                                             
//CTL1CNTL DD *                                               
  OPTION COPY                                                 
  INREC BUILD=(C'DATE :',66,2,C'/',64,2,C'/',60,4,80:X)       
/*
Back to top
View user's profile Send private message
jvsamycts

New User


Joined: 15 May 2008
Posts: 4
Location: Chennai

PostPosted: Tue Nov 03, 2009 7:59 pm
Reply with quote

Thanks Sambhaji.... But i need to attain this using SORT....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 03, 2009 8:15 pm
Reply with quote

ICETOOL is part of the DFSORT product
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Nov 03, 2009 10:40 pm
Reply with quote

jvsamycts,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  OUTFIL REMOVECC,NODETAIL,                     
  HEADER1=('DATE  : ',64,2,C'/',66,2,C'/',60,4),
  TRAILER1=('COUNT : ',COUNT)                   
//*
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top