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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts count contained values of several col... DB2 5
No new posts DB2 Query to get the count of Unique ... DB2 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
Search our Forums:


Back to Top