AnsweredAssumed Answered

Dynalloc Multiple SYSCTL files, one right after another

Question asked by JBM1 on Apr 30, 2013
Latest reply on May 1, 2013 by JBM1
Here's what we am trying to do. This is something that seems perfectly do-able but there is something that we are missing. Consider the following:

1) Multiple CVs, each with a uniquely named and properly initialized SYSCTL file
2) Each CV has a unique DB Name Table with DB names unique to that CV
3) Program runs, reading an input file that has as its primary sort sequence: CV#, DB name, Key of record
4) Sort puts all DB names in same CV# in ascending order

Key point: CV# and DB name are on every input record.

On first read, dynamically allocate the SYSCTL file that matches that DB name's CV. Do the BIND RUN-UNIT, BIND record(s) ], READY. Process all records with that DB name. On a DB name break, ensure same CV is being processed. If true, FINISH current RUN-UNIT, BIND new RUN-UNIT with new DB name and continue in this manner until a break on -BOTH- CV AND DB name.

If new CV encountered on a DB name break, Free [Unallocate] current SYSCTL and dynamically allocate the new SYSCTL file that matches DB name's CV. FINISH, BIND RUN-UNIT, etc.

Seems to make perfect sense but result is a 1494 after the second SYSCTL is [cleanly] dynalloc'd. Basically, IDMS still wants to point to the FIRST CV's SYSCTL and we see:

IDMS DB347011 V21 T298825 Dbname *** invalid

message in the FIRST CV's log.

Thinking that this was a potential FREEPOOL problem on 24-bit SYSCTL buffers, we added - BUFNO(0) - to the dynamic allocation of the SYSCTL. An explict FREE of SYSCTL is also done [as opposed a "SHR REUSE" on subsequent allocations].

No help there.

Just wondering: Is there something in CA-IDMS that establishes "One CV per TCB" or is there something here that we are missing?

P.S. We know this is a little bit of a "outside the box" question. If it can't be done, that's fine but if it can? Would like to know the trick.

Outcomes