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

Need (total count-1) records while writing TRAILER record


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

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Nov 07, 2011 10:01 am
Reply with quote

I have a requirement to count the correct number records present in my file excluding HEADER.

I have used below sort card which gives me RECORD count including HEADER --

Code:
//STEP45   EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN DD DSN=INPUT.DS,DISP=SHR   
//SORTOUT  DD DSN=OUTPUT.DS,           
//             DISP=(NEW,CATLG,DELETE),DATACLAS=DSIZE50,     
//             RECFM=FB,LRECL=1200                           
//SYSIN    DD *                                               
  OPTION COPY                                                 
  OUTFIL REMOVECC,                                           
  TRAILER1=(1:'999999',7:'99999999',15:COUNT=(M11,LENGTH=8)) 
/*   

As my input file already has HEADER record and 99 actual data records, so i used the above step to count the number records. But as expected, it gave me count of the actual data records + one count for HEADER record.

Means, it is giving me one count extra. I want to reduce this extra one count while writing trailer record in to the output file. Can i achieve this in the same control card or do i need to write one more extra step ?

P.S. : HEADER record does not have any identifier flag
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Nov 07, 2011 10:34 am
Reply with quote

Hi,

try
Code:
TRAILER1=(1:'999999',7:'99999999',15:COUNT-1=(M11,LENGTH=8))   



Gerry
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Nov 07, 2011 10:50 am
Reply with quote

awesome it worked out...
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top