Focal Point
MVS DYNAM / MOD KEEP

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5611002861

May 16, 2006, 04:07 PM
Stan
MVS DYNAM / MOD KEEP
I'm probably going to appear totally dumb here but I got asked to modify an older MVS Focus program and here is the problem. He is running numerous table file programs and holding them to a dynamically allocated dataset. Essentially he is simply appending data to the bottom of the dataset at the end of each Table file statement.

After each Table File statement, he is doing a DYNAM FREE on the dataset and then reallocating it using a statement such as:
DYNAM FREE DD EDW415L
DYNAM ALLOCDD EDW415L DS 'DATASET.NAME' MOD KEEP

Again the goal is just to append to EDW415L after each Table file statement that saves data as EDW415L.

However, because DATSET.NAME is on tape, our sy stem is dismounting the tape each time it is 'Freed' by the DYNAM FREE statement and then remounting it when we allocate it again.

Is this necessary or is there a way to just append to the dataset that I'm not thinking of today. (*I"m very blurry headed today for reasons involving sleep deprivation)

Essentially the file looks something like:

DD EDW415L DS 'APL2PEDW.PJ415.EDW415L' New...
TABLE FILE CAR
PRINT *
WHERE SOMETHING EQ 1
ON TABLE SAVE AS EDW415L
END
-RUN
DYNAM FREE DD EDW415L
DD EDW415L DS 'APL2PEDW.PJ415.EDW415L' MOD KEEP
TABLE FILE CAR
PRINT *
WHERE SOMETHING EQ 2
ON TABLE SAVE AS EDW415L
END
-RUN
DYNAM FREE DD EDW415L
DD EDW415L DS 'APL2PEDW.PJ415.EDW415L' MOD KEEP


...and so on.
May 16, 2006, 04:28 PM
<JG>
On mainframe MOD is the same as (APPEND in the windows and unix world.

There is no logical reason why you should have to reallocate the file between each step.

Except that the first allocation is NEW

which implies you are creating a new tape.

Your code is

DD EDW415L DS 'APL2PEDW.PJ415.EDW415L' New...

Trying to go back a long time to haul up my MVS starting point
(actually before DYNAM)

Can you not do

DD EDW415L DS 'APL2PEDW.PJ415.EDW415L' New... MOD KEEP

If you can, then the FREE and reallocation is not required.

However If you must issue the FREE, then the FREE is only required after the first step.
Once you issue the MOD it stays in effect for the session and so at most only one
FREE should be required.

MVS people speak up and test for us.
May 16, 2006, 05:46 PM
Tony A
If you have enough temp DISK storage (can't remember what the DD statements are) then you could HOLD to a new individual file for each request and then issue a final DYNAM CONCAT ........

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 17, 2006, 11:13 AM
ET
Assuming that the fields extracted are the same format for each hold file, why not just change the hold/mod cycles by using the universal concatenation "more" and thus creating just one file with all records.


FOCUS 7.6 MVS PDF,HTML,EXCEL
May 23, 2006, 11:19 AM
Sandy Weller
Stan,

Did you get this to work?

Sandy
May 30, 2006, 09:47 AM
Stan
Believe we got it to work.

Thanks!