View previous topic :: View next topic
|
Author |
Message |
senthils
Active User
Joined: 15 Nov 2005 Posts: 117 Location: Chennai, India
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
senthils
Active User
Joined: 15 Nov 2005 Posts: 117 Location: Chennai, India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is this a continuation of the other thread that you started ? |
|
Back to top |
|
|
senthils
Active User
Joined: 15 Nov 2005 Posts: 117 Location: Chennai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
after the write
check for limit minus max_reclen |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
senthils
Active User
Joined: 15 Nov 2005 Posts: 117 Location: Chennai, India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
senthils
Active User
Joined: 15 Nov 2005 Posts: 117 Location: Chennai, India
|
|
|
|
Thanks everyone for your quick replies. I will modify the logic of my program accordingly. |
|
Back to top |
|
|
|