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
 
add trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: add trailer
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    Post subject: Reply to: add trailer
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    Post subject:
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    Post subject: Reply to: add trailer
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm

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