View previous topic :: View next topic
|
Author |
Message |
srinathangya
New User
Joined: 19 Dec 2005 Posts: 77
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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
or is it always that way.
- When You say 'blank', may I co-relate with SPACES of COBOL? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Frank,
Thnak you for the information. I understand X'40'.
Quote: |
I don't know COBOL. |
..You seem to be in 'love' with DFSORT... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|