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

Position BSAM file on multi volume


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lbjerges

New User


Joined: 21 Aug 2013
Posts: 2
Location: Sweden

PostPosted: Thu May 07, 2020 8:13 pm
Reply with quote

Hi!
We have a in-house written checkpoint/restart framework that uses NOTE and POINT macros to keep track of sequential file positioning. The NOTE values are stored, along with sufficient file information in a DB2 table. This has been working OK for input and output FB and VB files as long as the files are residing on one volume.
My problem is as follows:
When the files are allocated on multiple volumes, which may be the case for "regular" files and, in our case, also for zEDC encrypted files There is a problem when I need to position a restart point on another volume than the first. Note that the zEDC files are single stripe which, I believe, means that they behave in the dame manner as regular multi volume files as oppose to if they were multi striped in which case the NOTE macro would return a relative block number that, from what I believe, could be used directly in a POINT macro to position the file in the correct place.
My problem is that I, after trying to search IBM Manuals a lot, have not found a clue on how to position my files on the correct volume. This prereq on the other hand, I have found referenced in more than on place in the documentation. If I only do a POINT macro with the value returned from the stored return of the corresponding NOTE macro it will by default be positioned on the first volume.
The "hard" way would be to, for an input file, open it in input mode and read blocks until I have "spilled over" on the proper relative volume then do the POINT and for an output file open it in INPUTOUTPUT mode and basically do the same thing and then start to write from that position.
This, I think is not very nice programming so I would think that there must be a better way to:
o Position to the proper volume
o Issue the POINT macro
o Go about "business as usual".
Does anybody have an idea on how to go about accomplishing this?

Than you in advance, Lars
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu May 07, 2020 11:16 pm
Reply with quote

I carefully read the discussion of NOTE in z/OS DFSMS Macro Instructions for Data Sets. The discussion mentions multiple volumes only in the context of "current volume." In other words - and I'm only guessing here - your program must append knowledge of the current volume to the output from NOTE and, before the POINT macro, switch to the appropriate volume and then POINT to the record. I truly wish I could be more helpful, but I have to admit I've never used NOTE/POINT so I have no experience to back up my guess.

If possible, please let us know how this turns out.
Back to top
View user's profile Send private message
lbjerges

New User


Joined: 21 Aug 2013
Posts: 2
Location: Sweden

PostPosted: Fri May 08, 2020 9:18 am
Reply with quote

Thanks Steve.
I know (I guess), I came to the same conclusion when reading the manual but the problem is the phrasing "switch to the appropriate volume". That phrase is mentioned in different places but I have not found any reference on how to do it.
Currently I have activated an end-of-volume exit on the DCBs from which I retrieve the relative volume number, the first being zero, the next one and so on. My crude logic as of now is to, for an input file:
o Open it
o Read blocks until I hit the same relative volume number as in the checkpoint e.g. #1
o Do the POINT
o Carry on reading to process
But I would imagine that there should be a more direct and logical way just to position on a specific volume.

Regards Lars
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri May 08, 2020 9:41 am
Reply with quote

I've put some more thought about this.

I recall thinking about this as a generic problem years and years ago. Don't ask how many years, please. I do know - then - that I never came to any real conclusions, so I guess it was beyond my limited knowledge then.

The topic starter failed to mention whether the data set was on disk or tape. My discussion here is limited to disk. Tape presents more difficulties.

Now I mentioned that you have to append volume information to the value you get from NOTE. This still goes. The TS talked about doing a volume switch. I think this may be what stopped me years and years ago. Years and years ago was before dynamic allocation or maybe I didn't know how to achieve this effect. With dynamic allocation you can define each volume as a separate data set, open each volume as though it were a separate data set. You do the volume switch by selecting the appropriate DCB.

You use the DALDSSEQ key to specify the volume. There is JCL to achieve an equivalent effect. I think you have to work this way, clumsy as it sounds, because I'm pretty sure it will work with data sets defined on SMS managed volumes, where SMS data sets can't be allocated directly by volume, which was first thought about tackling this problem.

Now I think this will work, but I've never tried it, so take my thoughts as a possible approach, nothing more. Good luck!
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
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
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top