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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rohanthengal

Active User


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

PostPosted: Mon Nov 07, 2011 10:01 am    Post subject: Need (total count-1) records while writing TRAILER record
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: 1703
Location: Australia

PostPosted: Mon Nov 07, 2011 10:34 am    Post subject:
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: 179
Location: Globe, India

PostPosted: Mon Nov 07, 2011 10:50 am    Post subject:
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    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
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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