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 Profile Log in to check your private messages Log in
 
VSAM varible block record length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: VSAM varible block record length
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: 2441
Location: Netherlands, Amstelveen

PostPosted: Sat Jun 19, 2010 1:48 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat Jun 19, 2010 2:06 pm    Post subject:
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Sat Jun 19, 2010 2:20 pm    Post subject:
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: 2441
Location: Netherlands, Amstelveen

PostPosted: Sat Jun 19, 2010 2:28 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

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