Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 181
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: 181
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us