MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Defining an AIBNAME for use in an EXEC DLI call

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Tue Jul 10, 2018 8:18 am    Post subject: Defining an AIBNAME for use in an EXEC DLI call Reply with quote

I'm trying to understand how I define my PSB so as to use an AIB name in my cobol code. At the moment, the standard method of accessing a database is
Code:

     EXEC DLI GN                             
              USING PCB      (1)             
              SEGMENT        (SDC16PA)       
              INTO           (SDC16PA)       
              SEGLENGTH      (PA-SEGLENGTH)   
     END-EXEC                                 

If I understand the manual correctly, I can change this call to
Code:

     EXEC DLI GN                             
              AIB(AIBNAME)             
              SEGMENT        (SDC16PA)       
              INTO           (SDC16PA)       
              SEGLENGTH      (PA-SEGLENGTH)   
     END-EXEC                                 

Where I'm getting stuck is how I define the AIB name in my PSB. I'm trying the following (unfortunately, where I work, any changes to a PSB aren't genned until the next day). This is my best attempt which compiled okay (not that that actually says anything)
Code:

* PCB 1                                                                 
 PCB           TYPE=DB,DBDNAME=DDC16,PCBNAME=FRED,                    *
               PROCOPT=G,KEYLEN=45                                     
 SENSEG        NAME=SDC16PA,PARENT=0,PROCOPT=G                         
 SENSEG        NAME=SDC16PC,PARENT=SDC16PA,PROCOPT=G                   

The use of the word FRED is deliberate here only so it's obvious that if I say I think/hope the AIB name is FRED everyone understands which value I'm referring to.

If I'm wrong, can anyone tell me how the PSB should be defined ????

Edited and added following. Fortunately, I had some old examples of what the layout was supposed to be. My problem was that I removed the PCB keyword. Here's my final example
Code:

* PCB 1                                                                 
DDC16   PCB    TYPE=DB,DBDNAME=DDC16,                                  *
               PROCOPT=G,KEYLEN=45                                     
        SENSEG NAME=SDC16PA,PARENT=0,PROCOPT=G                         
        SENSEG NAME=SDC16PC,PARENT=SDC16PA,PROCOPT=G                   



Now to see if I can access the database tomorrow using the AIB
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Wed Jul 11, 2018 1:57 am    Post subject: Reply with quote

I'll add how far I've come and see if anyone has a working example of what I'm trying to do. Here's my PSB
Code:

* PCB 1                                                                 
DDC16   PCB    TYPE=DB,DBDNAME=DDC16,                                  *
               PROCOPT=G,KEYLEN=45                                     
        SENSEG NAME=SDC16PA,PARENT=0,PROCOPT=G                         
        SENSEG NAME=SDC16PC,PARENT=SDC16PA,PROCOPT=G                   
* PCB 2                                                                 
DCF03   PCB    TYPE=DB,DBDNAME=DCF03,                                  *
               PROCOPT=G,KEYLEN=23                                     
        SENSEG NAME=SCF03CA,PARENT=0,PROCOPT=G                         
* PCB 3                                                                 
DAT22   PCB    TYPE=DB,DBDNAME=DAT22,PCBNAME=DAT22,                    *
               PROCOPT=G,KEYLEN=48                                     
        SENSEG NAME=SAT22VA,PARENT=0,PROCOPT=G                         
*                                                                       
 PSBGEN        LANG=COBOL,PSBNAME=PQC75                                 
*                                                                       
 END                                                                   


I've defined the AIB area as
Code:

       01  AIB.                                                       
           05 AIBID                     PIC X(8)        VALUE 'DFSAIB'.
           05 AIBLEN                    PIC S9(8) COMP  VALUE +128.   
           05 AIBSFUNC                  PIC X(8).                     
           05 AIBRSNM1                  PIC X(8).                     
           05 FILLER                    PIC X(16).                     
           05 AIBOALEN                  PIC S9(8) COMP.               
           05 AIBOAUSE                  PIC S9(8) COMP.               
           05 FILLER                    PIC X(12).                     
           05 AIBRETRN-X.                                             
             10 AIBRETRN                PIC S9(8) COMP.               
           05 AIBREASN-X.                                             
             10 AIBREASN                PIC S9(8) COMP.               
           05 FILLER                    PIC X(4).                     
           05 AIBRSA1                   POINTER.                       
           05 FILLER                    PIC X(48).                     

and my EXEC DLI call looks like this
Code:

           move 'DDC16'                   to AIBRSNM1               
           move length of sdc16pa     to AIBOALEN           
           move 'GN'                         to AIBSFUNC       
      * This commented EXEC DLI call is an example of one that also failed                                 
      *    EXEC DLI GN                                   
      *                   AIB      (AIB)                 
      *             SEGMENT        (SDC16PA)             
      *             INTO           (SDC16PA)             
      *             SEGLENGTH      (PA-SEGLENGTH)       
      *    END-EXEC                                     
           EXEC DLI GN                                   
                          AIB      (AIB)                 
                          into     (SDC16PA)             
           END-EXEC                                     


Whichever variation I use, I abend.

Does anyone have an example of an EXEC DLI call that uses an AIB ?

Forgot to mention, the existing PCB code looks like this
Code:

           EXEC DLI GN                               
                    USING PCB      (1)               
                    SEGMENT        (SDC16PA)         
                    INTO           (SDC16PA)         
                    SEGLENGTH      (PA-SEGLENGTH)   
           END-EXEC                                 

works fine, so there's nothing wrong with the database or anything like that.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Jul 11, 2018 3:30 am    Post subject: Reply with quote

Have you seen this?
https://www.slideshare.net/IBMIMS/the-aib-interface-66684754
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Wed Jul 11, 2018 4:45 am    Post subject: Reply with quote

No, I hadn't, but it didn't seem to say anything other than what I'm already doing. I'll repeat (to clear the clutter). My GN call looks like this
Code:

     move 'DDC16' to        AIB-pcb-name         
     move length of sdc16pa to AIB-seg-length                             
     EXEC DLI GN                                 
                    AIB      (aib)               
                    into     (SDC16PA)           
     END-EXEC                                   


and the contents of the AIB area look like this
Quote:

01 AIB.
05 AIBID > DFSAIB
05 AIBLEN > +00000128
05 AIBSFUNC >
05 AIB-pcb-name > DDC16
05 FILLER > ................
05 AIB-seg-length > +00000050
05 AIBOAUSE > +00000000
05 FILLER > ............
05 AIBRETRN-X.
10 AIBRETRN > +00000000
05 AIBREASN-X.
10 AIBREASN > +00000000
05 FILLER > ....
05 AIBRSA1 > 00000000
05 FILLER > ........................

and the call crashes with a U1041 abend.

If I'm coding the call incorrectly, then I'm not sure what it should look like.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Fri Jul 13, 2018 6:42 am    Post subject: Reply with quote

A simple follow-on question. In an IBM manual I found the following:-
Quote:

LIST=NO must not be specified on any PCBs in the PSB

What is the default value if you don't specify any LIST parm/value ?
(if it turns out to be No, then that might explain WHY the program crashes)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Aug 29, 2018 4:04 am    Post subject: Reply with quote

I am wondering if you resolved this?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Sat Sep 01, 2018 1:36 am    Post subject: Reply with quote

No. Whenever I have a little time over, I try and think up some new variation I haven't tried. And see if that'll help.

Next week, when I'm back at work, I'll paste in the AIB result variables after the call crashes, but they didn't seem to help much (return and reason codes were both zero)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Wed Sep 05, 2018 4:10 am    Post subject: Reply with quote

Okay, here is the AIB block after the crash
Code:

01 AIB                                                           
 02 AIBID                           X(8)              DFSAIB     
 02 AIBLEN                          9(9)     COMP     128         
 02 AIBSFUNC                        X(8)              SPACES     
 02 AIB-PCB-NAME                    X(8)              DDC16       
 02 FILLER                          X(16)             LOW-VALUES 
 02 AIB-SEG-LENGTH                  9(9)     COMP     50         
 02 AIBOAUSE                        9(9)     COMP     0           
 02 FILLER                          X(12)             LOW-VALUES 
 02 AIBRETRN-X                                                   
  03 AIBRETRN                       9(9)     COMP     0           
 02 AIBREASN-X                                                   
  03 AIBREASN                       9(9)     COMP     0           
 02 FILLER                          X(4)              LOW-VALUES 
 02 AIBRSA1                                 POINTER X'00000000'   
 02 FILLER                          X(48)             LOW-VALUES 


DDC16 is the name of the AIB in the PSB, and 50 is the length of the segment to retrieve. Here is te actual "compiled" code when debugging
Code:

    move 'DDC16' to        AIB-pcb-name                             
    move length of sdc16pa to AIB-seg-length                       
                                                                   
 XEC DLI GET NEXT                                                   
                      AIB      (aib)                               
                SEGMENT        (SDC16PA)                           
                INTO           (SDC16PA)                           
                SEGLENGTH      (PA-SEGLENGTH)                       
       END-EXEC                                                     
    Move '04' to dibver of dlzdib                                   
    Call 'DFHEI1' using by content x'000c780007010101c4d3c9404040   
    '4040f0f0f9f2f940404094100084000000' by reference dlzdib by     
    reference aib by content 'SDC16PA ' by reference SDC16PA by     
    reference PA-SEGLENGTH end-call                                 


As I mentioned earlier, if I do an ordinary GET NEXT USING PCB ...
as shown here
Code:

XEC DLI GET NEXT                                                 
               USING PCB      (1)                                 
               SEGMENT        (SDC16PA)                           
               INTO           (SDC16PA)                           
               SEGLENGTH      (PA-SEGLENGTH)                     
      END-EXEC                                                   
   Move '04' to dibver of dlzdib                                 
   Move 1 to dfhb0020                                             
   Call 'DFHEI1' using by content x'000c780007010101c4d3c9404040 
   '4040f0f0f9f1f3404040d0100084000000' by reference dlzdib by   
   reference dfhb0020 by content 'SDC16PA ' by reference SDC16PA 
    by reference PA-SEGLENGTH end-call                           

the code works fine
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group