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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 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
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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