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

add trailer


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

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Thu Oct 22, 2009 11:27 pm
Reply with quote

i want to add trailer record to a data file which will contain a hardcoded reacord type '2' and count of all rcords excluding trailer record newly written. pls help.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 22, 2009 11:48 pm
Reply with quote

Cics Fan,

Code:

//STEP0100 EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                       
A                                     
B                                     
C                                     
D                                     
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                       
  SORT FIELDS=COPY                     
  OUTFIL REMOVECC,TRAILER1=('2',COUNT)
/*


The output of the above job is as below. All the data records are copied as is and a trailer record is added with '2' in pos 1 followed by a 8 byte count with leading zeros suppressed.

Code:

A         
B         
C         
D         
2       4 
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Fri Oct 23, 2009 5:52 pm
Reply with quote

I have same requirement like above. But I need trailer without leading zeros supressed for that 8 bytes. Could anyone help me on this....
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Oct 23, 2009 8:34 pm
Reply with quote

Senthilkumar k,

use the following control cards

Code:

//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,TRAILER1=('2',COUNT=(M11,LENGTH=8))
/*
Back to top
View user's profile Send private message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Mon Nov 09, 2009 1:46 pm
Reply with quote

Hi,

What if we are getting both header and trailer in the file. Now COUNT is going to include both the recs in the counting.

If we want to exclude the header and trailer count from the COUNT then how can we do that?

Thanks
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Mon Nov 09, 2009 2:27 pm
Reply with quote

mohitsaini wrote:
Now COUNT is going to include both the recs in the counting.

Yes. COUNT will give total records in the file.
mohitsaini wrote:

If we want to exclude the header and trailer count from the COUNT then how can we do that?

You can use COUNT+n or COUNT-n to add\subtract number from it.

If you want to exclude header and trailer from count you can use.
Code:

//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,TRAILER1=('2',COUNT-2=(M11,LENGTH=8))
/*
Back to top
View user's profile Send private message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Mon Nov 09, 2009 3:01 pm
Reply with quote

Thanks Sambha
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Mon Nov 09, 2009 3:13 pm
Reply with quote

You are welcome.. icon_smile.gif
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 Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
No new posts Build a trailer with total an count SYNCSORT 6
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
Search our Forums:

Back to Top