Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8154
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us