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
 

 

Having record length in first 2 bytes of a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Having record length in first 2 bytes of a VB file
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 21, 2013 6:37 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 21, 2013 6:56 pm    Post subject: Reply to: Having record length in first 2 bytes of a VB file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Aug 21, 2013 9:43 pm    Post subject: Reply to: Having record length in first 2 bytes of a VB file
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Aug 21, 2013 10:37 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 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
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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