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

File with variable record length


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

New User


Joined: 19 Dec 2005
Posts: 77

PostPosted: Thu Mar 13, 2008 8:10 am
Reply with quote

Hi Guys,
Can anyone tell me how to copy records of a file with RECFM=VB to a file with RECFM=FB?
May be this topic mite have already been discussed, in which case, pls show me the link. It will be helpful.

Reg,
Srinath.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 13, 2008 1:18 pm
Reply with quote

Search the forum on 'VTOF' (Variable TO Fix), you'll get a lot of hits for the problem in question. One such link is here..
www.ibmmainframes.com/viewtopic.php?t=28877&highlight=vtof
another one..
www.ibmmainframes.com/viewtopic.php?t=22149&highlight=vtof

If link doesn't provide the solution or You've further queris, get back to us.

BTW, rather, a good concern could be, when input VB file is of LRECL 80, you need output with LRECL 80 but FB & you used the below code
Code:
SORT FIELDS=COPY
OUTFIL FNAMES=FB1,VTOF,OUTREC=(5,76)

here, the FB output records for the FB1 data set will be 76 byte records containing positions 5-80 of the VB input records. Only positions 5-80 of VB input records longer than 80 bytes will be used for the 76-byte FB output records. But what about VB input records that are "shorter" than the 80 bytes needed to copy input positions 5-80 to the 76-byte FB output records?..gotcha...search the manauls now.. icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 13, 2008 8:58 pm
Reply with quote

You can use the technique described in the "VB to FB conversion" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 13, 2008 9:02 pm
Reply with quote

Anuj,

With DFSORT's VTOF function, "short" VB records are automatically padded with blanks to the FB length so records shorter than 76 bytes will be padded to 76 bytes. You can use VLFILL=C'c' to use a different padding character. If you want 80 byte records for the situation you describe, you can use:

Code:

   SORT FIELDS=COPY
  OUTFIL FNAMES=FB1,VTOF,OUTREC=(5,76,80:X)
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 13, 2008 10:27 pm
Reply with quote

Thank you Frank. I usually keep reading your papers, so i knew that.

Two little queries here,

- in a crude sense may I say that with VTOF default is
Code:
VLFILL=C' '

or is it always that way.

- When You say 'blank', may I co-relate with SPACES of COBOL?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 13, 2008 11:00 pm
Reply with quote

Yes, as documented, VLFILL=C' ' is the default with VTOF.

I don't know COBOL. When I say blank or space, I mean X'40'.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 14, 2008 2:13 am
Reply with quote

Frank,

Thnak you for the information. I understand X'40'.

Quote:
I don't know COBOL.
..You seem to be in 'love' with DFSORT... icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 14, 2008 2:52 am
Reply with quote

As a DFSORT developer, I try to make DFSORT as "lovable" as possible.

But my equivalent for COBOL is Assembler which is the language I code in and like best.
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 4
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