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

Knowing RBA value before write


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

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Dec 01, 2009 11:45 am
Reply with quote

hi,

using COBOL program, is there any possibility of knowing the RBA value of an ESDS file before actually doing a write on that file.


note:
I am not sure whether i should be posting it in this forum or in COBOL section.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Tue Dec 01, 2009 12:12 pm
Reply with quote

Writing is always to the end of the file, no need to know the RBA.
Reading is a different story, you can do that direct (supply RBA) or
sequential.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Dec 01, 2009 12:17 pm
Reply with quote

My requirement is that if the RBA goes beyond a certain value then I have to write into another file.

I know i can get the RBA value after the write command is executed, but my coding logic will become easy if i can know the RBA value before writing.

So is there any possibility?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 01, 2009 12:31 pm
Reply with quote

Is this a continuation of the other thread that you started ?
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Dec 01, 2009 12:33 pm
Reply with quote

Yes. But i thought this will fall under a separate topic since this is more of a COBOL command which i am looking for.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 01, 2009 12:46 pm
Reply with quote

after the write
check for limit minus max_reclen
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 01, 2009 12:49 pm
Reply with quote

Well, think about it. The situation that you find yourself in for asking this topic is explained in the previous topic, so for people to really know what is happening they will need to know to read another post.

Now we are looking at changing a program to write to either one of N files. What about the implications of this, as if you have one logical file spread over two physical ESDS then you will need to change every other program that reads the ESDS as you can not concatenate VSAM files to a single DD.

If you need to make a program change, why not spend the time and effort in getting the original program to work properly rather than creating a new monster to deal with at a later date.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 01, 2009 1:04 pm
Reply with quote

Why can't you just rely on the error codes you would receive when you try to write a record and there is no more room?

not only would you be saved the computation before every write,
but you would have the trap at the correct place.

also, sounds as if you need an index to the multiple vsam files,
which you could update upon receiving the end-of-file error.
Gee, you could have n-number of vsam files.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Dec 01, 2009 1:05 pm
Reply with quote

hi expat,

This is a COBOL CICS environment. The programs already have been coded to take care of reading multiple ESDS files.

I am just coding a patch to take care of max RBA scenario. Thats why i wanted to know is there are any COBOL CICS command to know the RBA value before writing.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 01, 2009 4:16 pm
Reply with quote

How is CICS supposed to know how long a file is until it attempts to write to it? Answer: as expected, it cannot. You can capture the RBA or XRBA upon doing the WRITE but I'm not aware of any commands that will tell you the high used RBA in CICS without doing the WRITE.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Dec 01, 2009 4:22 pm
Reply with quote

Thanks everyone for your quick replies. I will modify the logic of my program accordingly.
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 Write line by line from two files DFSORT/ICETOOL 7
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts JCL to write the log on to a PDS file JCL & VSAM 10
No new posts COBOL - create and write to output fi... COBOL Programming 0
Search our Forums:

Back to Top