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

GU call using PL/1


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Mon Oct 21, 2013 10:56 am
Reply with quote

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Mon Oct 21, 2013 2:58 pm
Reply with quote

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
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Mon Oct 21, 2013 3:29 pm
Reply with quote

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
View user's profile Send private message
Gary Jacek

New User


Joined: 17 Dec 2007
Posts: 64
Location: Victoria, BC, Canada

PostPosted: Tue Oct 22, 2013 3:46 am
Reply with quote

Have you tried

2 ROP1 CHAR(2) INIT(' >'),


?
Back to top
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Tue Oct 22, 2013 9:39 am
Reply with quote

Hi,

Thanks for thesuggestion ... i tried the below as well.. but now getting status code 'AD' icon_sad.gif

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Oct 22, 2013 11:31 am
Reply with quote

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
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Tue Oct 22, 2013 5:08 pm
Reply with quote

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Tue Oct 22, 2013 6:48 pm
Reply with quote

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
View user's profile Send private message
Gary Jacek

New User


Joined: 17 Dec 2007
Posts: 64
Location: Victoria, BC, Canada

PostPosted: Tue Oct 22, 2013 8:23 pm
Reply with quote

Good catch Mistah Kurtz. It is difficult to put '0002587248 ' into a CHAR(4) field.
Back to top
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Wed Oct 23, 2013 9:08 am
Reply with quote

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
View user's profile Send private message
Appu

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Wed Oct 23, 2013 10:11 am
Reply with quote

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Oct 23, 2013 11:09 am
Reply with quote

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
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
No new posts CICS DPL call CICS 6
Search our Forums:

Back to Top