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
 

 

Updating the existing Trailer

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

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Dec 06, 2007 10:32 pm    Post subject: Updating the existing Trailer
Reply with quote

Hi All,
I have a VB file with header, trailer and detail record. Header record will start with 'A' in the first 8 bytes and Trailer record will have as shown below.

AAAAAAAA --> Header
FC232343
DE343523
ER343243
EE342423
999999999000000 - Trailer.

I want to update the trailer in the last 6 bytes with the actual number of records in teh file. How it can be done with ICETOOL and not with ICEMAN (as it wont work in my system).



Please dont say that it is already there in this forum, I already did numerous search with different combinations of words but none of the entry satisfies my query.
So Please help me on this as I have struck up with this final requirement. Please advice!!!
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 06, 2007 10:41 pm    Post subject:
Reply with quote

Quote:
How it can be done with ICETOOL and not with ICEMAN (as it wont work in my system).


This statement makes no sense. If you can use PGM=ICETOOL, then you can use PGM=ICEMAN.

When you say "the actual number of records in the file" do you mean the number of data records (4 in your example) or the number of data + header + trailer records (6 in your example)?

Can a new trailer record be rebuilt as:

999999999cccccc

where cccccc is the count? Or do you need other fields from the original trailer record that you didn't show in your example?

You said the input file has RECFM=VB. What is the input file's LRECL?
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Fri Dec 07, 2007 9:18 am    Post subject:
Reply with quote

the count of records means, only the count of detail records, count of header and trailer should not be included. Length of the trailer and header will be as shown in the example above and only the length of detail record varies (from the above example with the actual file entries) and the LRECL is 436.

For your question

Quote:

Can a new trailer record be rebuilt as:

999999999cccccc

where cccccc is the count? Or do you need other fields from the original trailer record that you didn't show in your example?


Though the trailer will always contain '9' in the first 8 bytes followed by 6 bytes of count of no records, I will prefer to retain the original trailer in which the last six bytes will be the count of no of records.

Please advice!! This is the last thing I have to do with my requirement, once it is done, my task is over, Please help me on this.

Thanks and Regards,
Sakthi.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 07, 2007 9:49 pm    Post subject:
Reply with quote

Quote:
Though the trailer will always contain '9' in the first 8 bytes followed by 6 bytes of count of no records, I will prefer to retain the original trailer in which the last six bytes will be the count of no of records.


I don't see the difference between these two. They will both result in a 19-byte trailer with an RDW, eight 9's and a 6-character count.

You can rebuild the trailer record with a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=...  output file (VB/436)
//SYSIN    DD    *
  OPTION COPY,VLSCMP
  OMIT COND=(5,9,CH,EQ,C'999999999')
  OUTFIL REMOVECC,
    TRAILER1=(C'999999999',COUNT-1=(EDIT=(TTTTTT)))
/*


You can just change the count in the trailer record with a DFSORT job like this:

Code:

//X1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    VTOF,BUILD=(80X),
    TRAILER1=(C'NEWCT,''',COUNT-2=(EDIT=(TTTTTT)),C'''')
/*
//X2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=...  output file (VB/436)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(5,9,CH,EQ,C'999999999'),
    OVERLAY=(14:NEWCT))
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Nov 13, 2010 5:13 am    Post subject:
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use DFSORT's new IFTRAIL function to update the count in the existing trailer record quite easily like this:

Code:

//NEW   EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (VB/436)
//SORTOUT DD DSN=...  output file (VB/436)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL IFTRAIL=(HD=YES,
     TRLID=(5,9,CH,EQ,C'999999999'),
     TRLUPD=(14:COUNT=(EDIT=(TTTTTT))))
/*


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am


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