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

VSAM varible block record length


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Sat Jun 19, 2010 1:34 pm
Reply with quote

I am reading a VSAM file having variable length data and writing the same to VB sequential file if the record satisfies some particular condition.
Could any one tell me how can i get the length of each record from the VSAM file so that i can write the VB sequential file?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Jun 19, 2010 1:48 pm
Reply with quote

IDCAMS LISTCAT will give that information.
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Sat Jun 19, 2010 1:52 pm
Reply with quote

Peter, I am asking in terms of COBOL ...how can i calculate the length in cobol program? Pls advise.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Jun 19, 2010 2:06 pm
Reply with quote

Why do you need to know the length of a record to be able to write it out to a VB file.
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Sat Jun 19, 2010 2:09 pm
Reply with quote

because i dont want to have spaces or anything in last positions.. e.g., The maximum length is 4096 and if the record in vsam has length of 1000 , i dont want spaces in last 3096 places....and i think for writing Variable block file we have to pass the record length first..pls correct if i am wrong...
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Sat Jun 19, 2010 2:20 pm
Reply with quote

Hi,

From one of Bill O'Boyle's posts...

Quote:
After the introduction of COBOL2, version 3, you could specify -

RECORD IS VARYING IN SIZE FROM Minimum-Length TO Maximum-Length CHARACTERS DEPENDING ON WS-REC-LGTH.

03 WS-REC-LGTH PIC 9(08) BINARY.

Where WS-REC-LGTH in an unsigned WS variable. Personally, I always specify this as an unsigned binary-fullword, but it's not a mandate.

On a READ of a variable-length record, WS-REC-LGTH will contain the actual length.

On a WRITE (and before it is issued), the programmer would populate WS-REC-LGTH with the desired record-length.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Jun 19, 2010 2:28 pm
Reply with quote

Using the following clauses could do the job :

RECORDING MODE is V
RECORD is VARYING in SIZE from 1 to x
DEPENDING ON RECORD-SIZE.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
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
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top