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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Help need in sort card for Updating trailer count of a file
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    Post subject:
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 Moderator


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

PostPosted: Mon Aug 10, 2009 10:55 pm    Post subject:
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    Post subject: Reply to: Help need in sort card for Updating trailer count
Reply with quote

Thanks for ur Help !!!

I got it resolved ..
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: Tue Nov 02, 2010 11:36 pm    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:

  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:

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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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