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

How to update Trailer count for a VB File


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

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Tue Oct 13, 2015 10:09 pm
Reply with quote

Hi All,

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.

Thanks a lot.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 13, 2015 10:58 pm
Reply with quote

Have you looked at IFTRAIL on OUTFIL?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Oct 13, 2015 11:02 pm
Reply with quote

This seems to be a straightforward case of updating a trailer record.

Use IFTRAIL and TRLUPD and please spend some time in reading the DFSORT documentation.

.
Back to top
View user's profile Send private message
manas121

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Tue Oct 13, 2015 11:18 pm
Reply with quote

Bill Woodger wrote:
Have you looked at IFTRAIL on OUTFIL?


Yes Bill. I have looked.

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.

Thanks a lot.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Oct 13, 2015 11:36 pm
Reply with quote

Quote:
Actually The Trailer and Header record structure are almost same except on Position 27

Then why don't you make use of this condition in identifying trailer?

.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 13, 2015 11:37 pm
Reply with quote

Can you show what you tried and explain what about it didn't work?
Back to top
View user's profile Send private message
manas121

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Wed Oct 14, 2015 11:29 pm
Reply with quote

Bill Woodger wrote:
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.

Thanks.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Oct 15, 2015 2:14 am
Reply with quote

Why don't you type 'Update trailer count on vb file syncsort' in a Google and find tons of ways to do it? Please try.
Quote:

Actually in Test region, DFSORT is installed and in production, SYNCSORT is installed

why for?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Oct 15, 2015 3:05 am
Reply with quote

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).
Back to top
View user's profile Send private message
manas121

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Tue Nov 03, 2015 5:59 pm
Reply with quote

Bill Woodger wrote:
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.

Code:

SORT FIELDS=COPY
  INREC  IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,2,BI,5)),
         IFTHEN=(WHEN=(7,2,CH,EQ,X'FFFF'),
                 OVERLAY=(61:5,2,BI,SUB,+2,BI,LENGTH=2))
  OUTREC BUILD=(1,4,7)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 03, 2015 6:39 pm
Reply with quote

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.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
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
Search our Forums:

Back to Top