There is a VB File of Length 2048 Bytes. In Trailer Record, From 52-56 Position in below given code (I am not refering 4 bytes padding which usually present in start of each record in VB File), Trailer count is present.
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
013614 LNTA600 OMDSEORD l k êÌ MDSE ORDER DATA
FFDDECFFF44DDCECDDC11091109157013000DCEC4DDCCD4CCEC000324444444444444444
FF35316000064425694505350421284660014425069459041310005C0000000000000000
-------------------------------------------------------------------------------
Currently Record count is 13612 (Without Header and Trailer).On Position 55, The Hex Value '352C' is equivalent to 13612.
In a sort processing, 10 records have been removed (Header and Trailer still Exists). So now Total 13602 Records are present (Without header and Trailer). How to update the Trailer count 13602 on 52 - 56 Position by SORT Utility.
Actually The Trailer and Header record structure are almost same except on Position 27:
Header:
Code:
LNTA600 OMDSEORD l êÌ MDSE ORDER DATA
00DDECFFF44DDCECDDC11090000157013120DCEC4DDCCD4CCEC00000
00353160000644256945053000012846650044250694590413100000
Trailer
Code:
LNTA600 OMDSEORD l k êÌ MDSE ORDER DATA
FFDDECFFF44DDCECDDC11091109157013000DCEC4DDCCD4CCEC00032
FF35316000064425694505350421284660014425069459041310005C
I tried a code with OUTFIL, IFTRAIL, TRLID, TRLUPD condition but it was not working. I am trying to understand these concepts in more details. Could you please help me out how to write Sortcard for above situation.
Can you show what you tried and explain what about it didn't work?
Hi Bill,
While testing the IFTRAIL Sort card, Today I got to know that instead of DFSORT, SYNCSORT is installed on the Prod Environment where i need to implement it. Actually in Test region, DFSORT is installed and in production, SYNCSORT is installed. Now I am trying to find it out how to achive the desired result by SYNCSORT.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, that's an odd, pointless and potentially dangerous thing to do. It means, effectively, you are putting your SORT Control Cards into Production untested. Mention that to your boss, please.
You can try IFTRAIL in SyncSORT if you are up-to-date. Sometimes things are implemented but not documented.
If that fails (probably will, I don't know) then add a sequence number to each record and when you identify the trailer, subtract two from the sequence number, giving you your trailer count. You'll need to drop off the sequence number.
For a variable-length record, you need to add the sequence number at the beginning of each record, BUILD=(1,4,SEQNUM,2,BI,5) and to strip it later, BUILD=(1,4,7).
Well, that's an odd, pointless and potentially dangerous thing to do. It means, effectively, you are putting your SORT Control Cards into Production untested. Mention that to your boss, please.
You can try IFTRAIL in SyncSORT if you are up-to-date. Sometimes things are implemented but not documented.
If that fails (probably will, I don't know) then add a sequence number to each record and when you identify the trailer, subtract two from the sequence number, giving you your trailer count. You'll need to drop off the sequence number.
For a variable-length record, you need to add the sequence number at the beginning of each record, BUILD=(1,4,SEQNUM,2,BI,5) and to strip it later, BUILD=(1,4,7).
Thanks a lot Bill. As per your suggestion, i created below given sortcard and worked fine.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Bear in mind that this means you have a limited number of records which can appear on the file. You can double the limit with FI instead of BI, but otherwise you'll have to increase the size of the count field if you can have more than 32k-1 or 64k-1 records.