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

Help need in sort card for Updating trailer count of a file


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

New User


Joined: 08 Aug 2009
Posts: 3
Location: chennai

PostPosted: Sat Aug 08, 2009 2:42 pm
Reply with quote

Hi,

I have a file with say some 100 records(98 - detail + 1 HDR + 1 TRL) , based on one condition am OMIT ting some 5 detail records.

Now I need to update my TRL count as 95 ( 93 - detail + 1 HDR + 1 TRL).
I tried using OVERLAY but didnt work out ,

SORT FIELDS=COPY
OUTREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,START=0)),
IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),OVERLAY=(8:81,6))

My TRL record should looks like ,

TRL +422008 +31272891464.170000

From 8th position my TRL count starts , but using the OVERLAY i used(See at the top) am getting the TRL as ,

TRL +00422009+31272891464.170000

In This TRL record , i need to LEFT TRIM '0' in the TRL count and this TRL count also counts HDR record , which should not happen , I need TRL count only for DETAIL.

Please help.
THANKS IN ADVANCE icon_smile.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Sun Aug 09, 2009 11:54 am
Reply with quote

First thing am noticing is
Quote:

IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,START=0)),


You are using 8 byte sequence number but while overlaying you are using only first six bytes???


Quote:
IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),OVERLAY=(8:81,6))


Also where is the OMIT condition you have used in above SORTCARD?

You show us some sample input file records and then desired output for the same (Please use code tag)
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Aug 10, 2009 10:55 pm
Reply with quote

ashokkosha1,

I believe these DFSORT control statements will do what you want. However, it's not clear what you mean by "In This TRL record , i need to LEFT TRIM '0' in the TRL count" - do you just want the count to be +dddddd with leading zeros or do you actually want to remove the leading zeros, for example, if the count was 1234 would you want +001234 or +1234bb (b for blank)? I assumed the former.

Code:

  OPTION COPY                                                   
  INREC IFOUTLEN=80,                                             
   IFTHEN=(WHEN=INIT,                                           
     OVERLAY=(81:SEQNUM,6,ZD,87:81,6,ZD,SUB,+2,EDIT=(+TTTTTT))),
   IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),                             
     OVERLAY=(8:87,7))                                           
Back to top
View user's profile Send private message
ashokkosha1

New User


Joined: 08 Aug 2009
Posts: 3
Location: chennai

PostPosted: Tue Aug 11, 2009 10:24 pm
Reply with quote

Thanks for ur Help !!!

I got it resolved ..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Nov 02, 2010 11:36 pm
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:

  OPTION COPY                                         
  OUTFIL IFTRAIL=(HD=YES,TRLID=(1,3,CH,EQ,C'TRL'),     
    TRLUPD=(8:COUNT=(EDIT=(+TTTTTT))))                 


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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top