View previous topic :: View next topic
|
Author |
Message |
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hello Team,
As part of learning IMS, I have tried the below call. Here an SSA
has been written using a multiple field key search as follows .
But I am getting the AJ status code. I have verified the AJ status code
explanations ; but not getting this call worked.
Code: |
DCL 1 QUAL_SSA_VO STATIC UNALIGNED,
2 SEGNAME CHAR(8) INIT('SEG1 '),
2 PARA1 CHAR(1) INIT('('),
2 FLDNAME1 CHAR(8) INIT('REGNUM '),
2 ROP1 CHAR(2) INIT('GT'),
2 FLDVALUE1 CHAR(12) INIT('0002587247 '),
2 LAND CHAR(1) INIT('&'),
2 FLDNAME2 CHAR(8) INIT('REGNUM '),
2 ROP2 CHAR(2) INIT('LT'),
2 FLDVALUE2 CHAR(4) INIT('0002587248 '),
2 PARA2 CHAR(1) INIT(')'); |
Code'd
Please advise. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Status code 'AJ' suggests that your SSA is not in order with the PCB. Can you post the PLITDLI calls and the DBD source. |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi,
I dont think that is the reason. Because if I use my SSA as follows removing the condition after logical '&', it works perfectly fine.
Code: |
DCL 1 QUAL_SSA_VO STATIC UNALIGNED,
2 SEGNAME CHAR(8) INIT('SEG1 '),
2 PARA1 CHAR(1) INIT('('),
2 FLDNAME1 CHAR(8) INIT('REGNUM '),
2 ROP1 CHAR(2) INIT('GT'),
2 FLDVALUE1 CHAR(12) INIT('0002587247 '),
2 PARA2 CHAR(1) INIT(')');
|
Some problem with the concatenation of logical condition that I have used. Do we need to add any command code when we use multiple qualification statements in a single PLITDLI call ? |
|
Back to top |
|
|
Gary Jacek
New User
Joined: 17 Dec 2007 Posts: 64 Location: Victoria, BC, Canada
|
|
|
|
Have you tried
2 ROP1 CHAR(2) INIT(' >'),
? |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi,
Thanks for thesuggestion ... i tried the below as well.. but now getting status code 'AD'
Please advise..
Code: |
DCL 1 QUAL_SSA_VO STATIC UNALIGNED,
2 SEGNAME CHAR(8) INIT('SVO010VO'),
2 PARA1 CHAR(1) INIT('('),
2 FLDNAME1 CHAR(8) INIT('VOVSNR '),
2 ROP1 CHAR(2) INIT(' >'),
2 FLDVALUE1 CHAR(12) INIT('0002587246 '),
2 LAND CHAR(1) INIT('&'),
2 FLDNAME2 CHAR(8) INIT('VOVSNR '),
2 ROP2 CHAR(2) INIT(' <'),
2 FLDVALUE2 CHAR(4) INIT('0002587248 '),
2 PARA2 CHAR(1) INIT(')'); |
Code: |
DLI_COUNT = 4;
DLI_FUNC = 'GU';
CALL PLITDLI( DLI_COUNT,DLI_FUNC,DBPCB,SVO010VO_1,QUAL_SSA_VO); |
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
I still think there is something wrong with the PCB. Check this link.
Here I'm posting a sample, which I just tried in COBOL. Hope it helps.
PSB:
Code: |
PCB TYPE=DB,NAME=PNTDBHIS,PROCOPT=A,KEYLEN=21
SENSEG NAME=PATIENT,PARENT=0
SENSEG NAME=ILLNESS,PARENT=PATIENT
SENSEG NAME=TREATMNT,PARENT=ILLNESS
SENSEG NAME=BILLING,PARENT=PATIENT
SENSEG NAME=PAYMENT,PARENT=BILLING
SENSEG NAME=HOUSHLD,PARENT=PATIENT
PSBGEN PSBNAME=PNTPHISG,LANG=COBOL
END |
SSA:
Code: |
01 PATIENT-QUAL-SSA.
05 SEGMENT-NAME PIC X(08) VALUE 'PATIENT '.
05 LEFT-PAREN PIC X VALUE '('.
05 KEY-FIELD-NAME-1 PIC X(08) VALUE 'PATNO '.
05 RO-1 PIC X(02) VALUE '> '.
05 PATIENT-NUM-1 PIC X(05) VALUE '00001'.
05 LOGIC-OPER PIC X VALUE '&'.
05 KEY-FIELD-NAME-2 PIC X(08) VALUE 'PATNO '.
05 RO-2 PIC X(02) VALUE '< '.
05 PATIENT-NUM-2 PIC X(05) VALUE '00003'.
05 RIGHT-PAREN PIC X VALUE ')'.
|
Source:
Code: |
CALL 'CBLTDLI' USING FUNC-GU,
PCBMASK,
PATIENT-SEG,
PATIENT-QUAL-SSA
IF STATS IS = SPACES
DISPLAY 'PATIENT NUM ' PATIENT-NUM OF PATIENT-SEG
DISPLAY 'PATIENT NAME ' PATIENT-NAME OF PATIENT-SEG
DISPLAY 'PATIENT ADDR ' PATIENT-ADDR OF PATIENT-SEG
ELSE
DISPLAY 'BAD STATUS FROM GU CALL:' STATS
END-IF. |
Output:
Code: |
PATIENT NUM 00002
PATIENT NAME ABCDEF2
PATIENT ADDR 18,CHN 600023-2 |
|
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi,
Here is my PCB . Getting status code AJ now . Please advise if something is wrong :
Code: |
DVO911 PCB TYPE=DB,DBDNAME=DVO911,PROCOPT=GRD,KEYLEN=31
SENSEG NAME=SVO010VO,PARENT=0
SENSEG NAME=SVO010VK,PARENT=SVO010VO
PSBGEN LANG=PLI,PSBNAME=PHKTEST
END
|
One more doubt:
From manuals , it says that in an unqualified call we must provide the SEGNAME. So is it not possible to traverse a full IMS DB starting from root ? If we need that which segment name will we give in the unqualified SSA ? Giving the root segment name will suffice for a traversal through the full DB ? |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Is this a typo?
Quote: |
2 FLDVALUE2 CHAR(4) INIT('0002587248 '), |
You can use unqualified GN calls to retrieve all the segments of an IMS database. But you will have to take care of the Status code 'GA' in your program. |
|
Back to top |
|
|
Gary Jacek
New User
Joined: 17 Dec 2007 Posts: 64 Location: Victoria, BC, Canada
|
|
|
|
Good catch Mistah Kurtz. It is difficult to put '0002587248 ' into a CHAR(4) field. |
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi mistah kurtz,
Great ! that was a gud catch .. it finally worked ...
Regarding my 2nd question, even for unqualified calls we need to give segment name as mandatory right ? So can i use the below SSA to traverse the full IMS DB ?
Please note i have 2 segments - SVO010VO ( root ) and SVO010VK(child)
Code: |
DCL 1 UNQUAL_SSA STATIC UNALIGNED,
2 SEGNAME CHAR(8) INIT('SVO010VO'),
2 ASTERISK CHAR(1) INIT('*'),
2 CMDCODE CHAR(1),
2 BLANK CHAR(1);
|
|
|
Back to top |
|
|
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hi all,
I got the answer .. A GU call without using any SSA will read all the segments causing a GB at the end. Many thanks ! |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Quote: |
even for unqualified calls we need to give segment name as mandatory right ? |
NO.
Quote: |
A GU call without using any SSA will read all the segments causing a GB at the end. |
NO. A GU call without an SSA will set the pointer at the beginning of the database. After that you should use GN calls to read the subsequent segment.
Fisrt try to understand different types of DL/I calls:
1. GU/GN call without an SSA
2. GU/GN call with unqualified SSA
3. GU/GN call with qualified SSA
Check this link. |
|
Back to top |
|
|
|