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
 

 

File with variable record length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: File with variable record length
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

Senior Member


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

PostPosted: Thu Mar 13, 2008 1:18 pm    Post subject:
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..
http://www.ibmmainframes.com/viewtopic.php?t=28877&highlight=vtof
another one..
http://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 Moderator


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

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

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

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

DFSORT Moderator


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

PostPosted: Thu Mar 13, 2008 9:02 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 13, 2008 10:27 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 13, 2008 11:00 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Mar 14, 2008 2:13 am    Post subject:
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 Moderator


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

PostPosted: Fri Mar 14, 2008 2:52 am    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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