The field UIBPCBAL points to a list of n PCB pointers to access the IMS DB.
If the structure of the PSB ("number of IMS DBs in PSB") is known, i can access the PCB ADDRESS LIST with an index to get the PCB for a specific IMS DB. No problem so far.
But, if my program works with different PSBs, the PCB ADDRESS LIST may have a diffrent length, depending on the PSB (allocated by PLITDL PCB .....).
So question is: How can I obtain the length (number of valid elements) of the PCB ADDRESS LIST to walk though the list and check each PCB if it is the required PCB ?
/* -----------------------------------------*/
/* Get PSB */
/* -----------------------------------------*/
PSB_NAME = GetPSBName();
CNTR = 3 ;
FUNC = 'PCB ';
CALL PLITDLI(CNTR,FUNC,PSB_NAME,UIBPTR);
IF UIBFCTR ^= '00000000'B THEN DO;
PUT SKIP EDIT('ERROR')(A);
SIGNAL ERROR ;
END;
ELSE DO;
END;
/* -----------------------------------------*/
/* Check available PCB's */
/* -----------------------------------------*/
DO I = 1 TO 256 ;
/* How many entries are valid ?????*/
CALL Check(PCB_ADDRESS_LIST(I));
END;
My problem now is, how many PCBs are available in the PSB? What's the real length of the PCB_ADDRES_LIST ?
When shall I terminate the loop over the PCB_ADDRESS_LIST ?
I cantn't find any hint's in the IBM manuals (and my IMS Coding time is so far ago ........).
If I limit the loop over the PCB_ADDRESS_LIST to to the number of PCBs in the PSB the coding works.
If I do not limit the loop, the result is, that the first valid elements are printed, and then
Code:
DFHAC2236 07/14/2014 09:12:07 CICSTSTM Transaction XXXX abend ASRA in program EQANCXOU term E000. Updates to local recoverable
resources will be backed out.
And the dli-function field can contain any of the following values:
Code:
GU Get Unique
GHU Get Hold Unique
GN Get Next
GHN Get Hold Next
GHNP Get Hold Next within Parent
DLET Delete
REPL Replace
ISRT Insert
FLD Field
POS Position
Your function code should be GN.
Convert these COBOL definitions to your PLI defintions
CALL PLITDLI(CNTR,FUNC,AIB-CNTL-BLOCK,IMS-IO-AREA);
IF AIBRETRN ^= '00000000'B THEN DO;
PUT SKIP EDIT('ERROR')(A);
SIGNAL ERROR ;
END;
ELSE DO;
print the contents of IMS-IO-AREA;
END;
Now you check the return code from the call and then contents of IMS-IO-AREA and print out the contents _________________ Kolusu
www.linkedin.com/in/kolusu
CICS Transaction Server for z/OS
Version 4 Release 2
Application Programming Guide, SC34-7158-02, Chapter 3, figure 1, page 28.
The PCB Call is used to schedule, allocate the PSB.
The IBM wording is "Using the DL/I CALL interface" for this technique.
In the mentioned manuals is explained, that after the PCB call is issued, the datastructure PCB_ADDRESS_LIST, see Cobol sample in SC34-7158-02, is available, filled. Afterwards you can obtain the PCB Pointer (IMS DB pointer) from this data structure. Now you can issue IMS DB Call for example GU, GN, REPL .....
What do you meen with your prior question: "How are accessing IMS from CICS? via LU or DBCTL" ?
In my CICS region I can see the messages
DFHSI8440I XXXXXXXX Initiating connection to DBCTL.
DFHSI8441I XXXXXXXX Connection to DBCTL YYYYYYYY successfully completed.
with XXXXXXXX = Name of my CICS region
YYYYYYYY = name of my IMS region.
If I use a pointer from the PCB_ADDRESS_LIST structure, I can access the IMS DB with GU, GN or what else. This works. No problem.
The only problem is:
If the organization of the PSB is know (which database is at which position) I can use index 1, 2, ...n to access the PCB_ADDRESS_LIST (as done in the IBM sample in SC34-7158-02).
If the organization of the PSB is NOT know (this is my situation, CICS program works with different PSBs), I want to check the PCB_ADDRESS_LIST structure to get the correct pointer to access the IMS DB. So I need to know, how many elements in the PCB_ADDRESS_LIST are valid (are valid PCB IMS DB pointers).
I hope, I was able now, to give a exact explaination of the problem
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
Posted: Wed Jul 16, 2014 10:19 am Post subject:
Hi *,
I have a solution now.
Code:
/* -----------------------------------------*/
/* Check available PCB's */
/* -----------------------------------------*/
/* HIGH END BIT is set in address of last PCB
in the PCB_ADDRESS_LIST,
so exit loop if HIGH END BIT is set
and this entry is processed */
DCL LAST_PCB BIN FIXED(31) BASED;
DO I = 1 TO 256 UNTIL(ADDR(PCB_ADDRESS_LIST(I)) -> LAST_PCB < 0);
CALL Check(PCB_ADDRESS_LIST(I));
END;
But I can not provide any reference to any IBM manual. The solution I found in discussion with a collegue.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum