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

Having record length in first 2 bytes of a VB file


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

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Wed Aug 21, 2013 5:37 pm
Reply with quote

Dear Friends,

I do have a requirement that I need to have the record length of every record in a VB file in first 2 bytes with the actual record preceeding that, copied to another VB file.

Is this possible in SORT?

Thanks for your time.

Regards
Tanden
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 21, 2013 6:37 pm
Reply with quote

Unless I am mistaken,

The record length is always in the first two bytes of a VB record.
Using sort, the record length is pos 1 len 2 format BI

Or perhaps you want something different ???
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: Wed Aug 21, 2013 6:56 pm
Reply with quote

Can you run this and post the sysout from the step in the Code tags, please.

Code:
//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
Nothing to do with the solution, just for your SORT level
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*


Also please show a small example input and expected output.

It is not clear exactly what you want.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Aug 21, 2013 7:36 pm
Reply with quote

Is this for Microfocus load files by any chance?

I have to do the same thing for all of the Filemanager unloads on the mainframe. This is what I use:

Code:
//SYSIN     DD *                                   
 SORT FIELDS=COPY                                 
 OUTFIL OUTREC=(1,4,1,2,BI,SUB,+2,TO=BI,LENGTH=2,5)


It takes the first two byes in a VB file, subtracts 2 from that number, then put the answer as the first two "real" bytes int he output record, then it takes the rest of the data and adds it to the output record.

If you don't need to subtract two bytes, then make it like:
Code:
//SYSIN     DD *                                   
 SORT FIELDS=COPY                                 
 OUTFIL OUTREC=(1,4,1,2,5)


Code'd
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: Wed Aug 21, 2013 9:43 pm
Reply with quote

Yes, Ed. The only difficulty is in exactly what this (emphasis added) means...

Quote:
I need to have the record length of every record in a VB file in first 2 bytes with the actual record preceeding that
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 21, 2013 10:37 pm
Reply with quote

Count the actual record bytes with imaginary numbers? icon_smile.gif
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 Store the data for fixed length COBOL Programming 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 PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top