|
View previous topic :: View next topic
|
| Author |
Message |
ashokkosha1
New User

Joined: 08 Aug 2009 Posts: 3 Location: chennai
|
|
|
|
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  |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
ashokkosha1
New User

Joined: 08 Aug 2009 Posts: 3 Location: chennai
|
|
|
|
Thanks for ur Help !!!
I got it resolved .. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|