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
 

 

Can we write trailer in required format with count in DFSORT

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

New User


Joined: 07 Oct 2008
Posts: 3
Location: Bangalore, India

PostPosted: Wed Mar 04, 2009 4:11 pm    Post subject: Can we write trailer in required format with count in DFSORT
Reply with quote

Hi!

I have a requirement wherein I need to append a trailer record to a file in a specific format. The input file will have header and detail records. Assume header format like something having rec type, date created, file type fields. I need to write the trailer which is same as the header, except for an additional field with the count value (which includes the header and trailer while counting).

Can this be achieved through DFSORT/ICETOOL? I do not want to write a new COBOL program just for counting and attaching the trailer.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Mar 04, 2009 4:14 pm    Post subject:
Reply with quote

Had you have searched you would have found this topic posted today.

Click HERE to see anvery similar request.
Back to top
View user's profile Send private message
Dhivya Santosh

New User


Joined: 07 Oct 2008
Posts: 3
Location: Bangalore, India

PostPosted: Wed Mar 04, 2009 4:21 pm    Post subject:
Reply with quote

Hi,
I saw the reply already, but it did not answer one question. Sorry I had not been elaborate in my previous post.

Eg.
<header> 020080303K
<detail1> 1002897189009I20041201
<detail2> 1009922308245I20060923
:
:
<trailer> 920080303K002902 <say>

I can hardcode the rec type and file type, but I need to copy the date (which changes daily) from the header record to the trailer.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 04, 2009 10:41 pm    Post subject:
Reply with quote

dhivya santhosh,

You can very easily push the header record on to the trailer using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

I assumed your input is 80 byte lrecl and FB recfm

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
<HEADER> 020080303K                                     
<DETAIL1> 1002897189009I20041201                         
<DETAIL2> 1009922308245I20060923                         
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,EQ,C'<HEADER>'),
  PUSH=(81:11,9))                                       
  OUTFIL REMOVECC,BUILD=(1,80),                         
  TRAILER1=('<TRAILER> 9',81,9,COUNT=(M11,LENGTH=6))     
/*


The output from this job is
Code:

<HEADER> 020080303K                 
<DETAIL1> 1002897189009I20041201     
<DETAIL2> 1009922308245I20060923     
<TRAILER> 920080303K000003           


If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).

For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
Dhivya Santosh

New User


Joined: 07 Oct 2008
Posts: 3
Location: Bangalore, India

PostPosted: Mon Mar 16, 2009 5:02 pm    Post subject:
Reply with quote

Hi,

Thanks for the resolution. Sorry for the delay in getting back.
The above function is very useful and I used it for manipulating header record as well for another application.

Thanks again!!
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 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
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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