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
 

 

How to update the record count in already exitsting trailer.

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

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Thu Jul 23, 2009 12:06 pm    Post subject: How to update the record count in already exitsting trailer.
Reply with quote

Hi,

I have to omit some records from my input file and need to update the record count(new count) in trailer record.

I will take care of records omission.
So please help me in updating the record count in the trailer record.

My file's RECFM =VB and LRECL=5063.
file has 'FFFF' at positon 1 for trailer record alone.
Trailer count should be 8 bype PD format.

I am copying portion of the trailer record in Hex format for reference.(from 60 - 80). Here the count is 38.

444444444444400000008
00000000000000000003C


Please let me know if you need further details.


Thanks,
Prabhu.
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Thu Jul 23, 2009 5:58 pm    Post subject:
Reply with quote

I think this link can help you

http://ibmmainframes.com/viewtopic.php?t=42409&highlight=
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 Jul 23, 2009 9:49 pm    Post subject:
Reply with quote

Prabhu,

Does the count include the trailer record or is it just a count of the data records? That is, for your example are there 38 data records and a trailer record, or are there 37 data records and a trailer record?

Can the trailer record be rebuilt (e.g. it just has X'FFFF', blanks and the count) or is there something in the old trailer record that has to be kept for the new trailer record (what?).
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Fri Jul 24, 2009 11:30 am    Post subject: Reply to: How to update the record count in already exitstin
Reply with quote

Hi Frank,

In my file, one Header and one Trailer record will be there.

Count in the trailer record should be total detail record count. I.e excluding header and trailer.

Trailer is not required to re-build. Because old trailer needs to be copied as it is by updating the detail record count only.
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Fri Jul 24, 2009 4:08 pm    Post subject: Reply to: How to update the record count in already exitstin
Reply with quote

Frank,

when I use the below code, I am getting count of all the records including Header and trailer.

SORT FIELDS=COPY
OUTREC IFOUTLEN=5063,
IFTHEN=(WHEN=INIT,OVERLAY=(5064:SEQNUM,8,PD,START=1)),
IFTHEN=(WHEN=(5,2,BI,EQ,X'FFFF'),OVERLAY=(77:5064,8))


but I need the count of Detail records only i.e excludig Header and Trailer.

Could you please advice.

Thanks,
Prabhu.
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Fri Jul 24, 2009 4:41 pm    Post subject:
Reply with quote

What will be the value in 5,2 for detail records?

Regards
Tanden
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Fri Jul 24, 2009 7:45 pm    Post subject: Reply to: How to update the record count in already exitstin
Reply with quote

Tanden,

The value in 5,2 for detail records will not be unique.
It will have alphanumeric data.

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

Senior Member


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

PostPosted: Fri Jul 24, 2009 9:06 pm    Post subject: Reply to: How to update the record count in already exitstin
Reply with quote

ESSPRABHU,

Since your input is VB it is not a good idea to stick to the Seqnum at the end. We need to stick it right after the RDW and then later on remove it so that we preserve the original VB layout. Since you dont want the header and trailer to be part of the count , we subtract 2 from the seqnum which will give the count of just detail records

Adding the seqnum will push the data contents by 8 bytes

Code:

RDW |SEQNUM |13             |COUNT
1-4 |5-12   |DATA           |85   


Once we updated the count , then we remove the 8 bytes we added

Code:

RDW |5             |COUNT 
1-4 |DATA          |77     

Use the following control cards
Code:

//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,8,PD,5)), 
  IFTHEN=(WHEN=(13,2,CH,EQ,X'FFFF'),                   
  OVERLAY=(85:5,8,PD,SUB,+2,PD,LENGTH=8))             
  OUTREC BUILD=(1,4,13)                               
//*
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Mon Jul 27, 2009 4:22 pm    Post subject: Reply to: How to update the record count in already exitstin
Reply with quote

Hi Skolusu,

Thanks for your reply.
The code is working perfectly.
Thanks for your suggestion on Sequence number postion.


Prabhu...
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 Oct 30, 2010 1:43 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 do this more easily like this:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD *
  OPTION COPY
  OUTFIL IFTRAIL=(HD=YES,TRLID=(5,2,BI,EQ,X'FFFF'),
    TRLUPD=(77:COUNT=(TO=PD,LENGTH=8)))
/*


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 CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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