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

Getting return code AC on IMS call


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

New User


Joined: 16 Dec 2011
Posts: 4
Location: India

PostPosted: Tue May 29, 2012 1:44 pm
Reply with quote

I am writing a new program which will be using an already existing transaction and PSB.

Say, existing program : CI06
existing PSB : CCI06
and new program: CCI06X

The programs accesses two databases, ORDER and CUSTMER.

The ORDER database looks like:->

Code:
|------------|
| order      |   The key for order segment is order-number. Fields are
|------------|   order-date,order-customer etc.
      |
      |
      |
|------------|   The key for section segment is section-number,
|section     |   section-address-id etc.
|------------|





The CUSTMER database looks like:->

Code:
|----------------|
| customer       |   The key for customer segment is customer-number.
|----------------|    Fields are customer-name,customer-terms etc.
      |
      |------------------------|
      |                              |
|------------|          |-----------------|
|address    |          | ordptrsc        | 
|------------|          |-----------------|

address and ordptrsc being in the same level.

The key for address segment is address-code. Fields are address-name, address-line etc.

The initial program (CCI06) used customer and ordptrsc segment. It did not use address segment.

But,for my program (CCI06X) I do not need ordptrsc segment. Also, I need address segment.

The initial PCB for CUSTMER was like:->

Code:
CUSTMER  PCB   TYPE=DB,DBDNAME=PCUSTMER,KEYLEN=07           
         SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP           
         SENSEG NAME=ORDPTRSC,PARENT=CUSTOMER,PROCOPT=GD   
     

I changed it to :->

Code:
CUSTMER  PCB   TYPE=DB,DBDNAME=PCUSTMER,KEYLEN=09           
         SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP           
         SENSEG NAME=ORDPTRSC,PARENT=CUSTOMER,PROCOPT=GD   
         SENSEG NAME=ADDRESS,PARENT=CUSTOMER               


What I intend to do is as follows:->

1. Get all orders for a specific time period (say, for a specific financial year) from ORDER database.
2. For each of these order-number, fetch the section segment
3. Go to CUSTMER database and fetch specific address segment for which
(customer-number = order-customer
and
address-code = section-address-id)


For this, what I am doing is as follows:->

1. GN call for ORDER database in order segment with order-date in that range.
2. GU call for ORDER database in section segment to fetch section-address-id.
3. GU call for CUSTMER database in address segment with two SSA's in serial,one for customer number and next for address-code.

I am getting AC return code in the third IMS call (in CUSTMER).

Please help.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue May 29, 2012 2:16 pm
Reply with quote

Can you try ur PCB as below :

Code:

CUSTMER  PCB   TYPE=DB,DBDNAME=PCUSTMER,KEYLEN=09           
         SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP           
         SENSEG NAME=ADDRESS,PARENT=CUSTOMER 
         SENSEG NAME=ORDPTRSC,PARENT=CUSTOMER,PROCOPT=GD   

Back to top
View user's profile Send private message
suvojyoti chowdhury

New User


Joined: 16 Dec 2011
Posts: 4
Location: India

PostPosted: Tue May 29, 2012 2:31 pm
Reply with quote

Hi Rajesh,
I tried..but still got the same result.. icon_sad.gif
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue May 29, 2012 3:00 pm
Reply with quote

Quote:

For this, what I am doing is as follows:->

1. GN call for ORDER database in order segment with order-date in that range.
2. GU call for ORDER database in section segment to fetch section-address-id.
3. GU call for CUSTMER database in address segment with two SSA's in serial,one for customer number and next for address-code.



=> GU Call will always tries to search the database from the very first segment in the database. SUggest you to change the 2nd call to GNP as u would like to get the SECTION segment available under the identified ORDER segment.

=> can u paste your IMS calls once...
Back to top
View user's profile Send private message
suvojyoti chowdhury

New User


Joined: 16 Dec 2011
Posts: 4
Location: India

PostPosted: Tue May 29, 2012 3:12 pm
Reply with quote

Hi Rajesh,

Perhaps I have previously mistook the IMS calls...it is currently GU,GN and GU. Should it be GN,GNP and GU?
Do you think this could be the problem?


Here are my IMS calls:


1.

Code:
CALL 'CBLTDLI' USING GU             
                     ORDERSC-PCB     
                     SEG-ORDERSC     
                     SSA-ORDERSC-DATE
SSA:

 01  SSA-ORDERSC-DATE.                                         
     05  FILLER         PIC X(19) VALUE 'ORDERSC(ORDRCOMDLE'.                     
     05  FILLER         PIC X(6) VALUE '120331'.               
     05  FILLER         PIC X(11) VALUE '*ORDRCOMDGE'.         
     05  FILLER         PIC X(6) VALUE '110401'.                             
     05  FILLER         PIC X     VALUE ')'.             

2.

MOVE ORDR-BSC-NO TO SSA-ORDR-KEY

CALL 'CBLTDLI' USING GN               
                     ORDERSC-PCB       
                     SEG-SECTION       
                     SSA-ORDERSC       
                     SSA-SECTION-UNQ. 
SSA:

01  SSA-ORDERSC.                                             
    05  FILLER        PIC X(19) VALUE 'ORDERSC (ORDRBSNO ='.
    05  SSA-ORDR-KEY  PIC X(7).                             
    05  FILLER        PIC X     VALUE ')'.     

01  SSA-SECTION-UNQ   PIC X(9)  VALUE 'SECTION  '.

3.

MOVE  ORDR-CUST-NO        TO   SSA-CUST-KEY
MOVE  SECT-CONS-ADDR-ID-1 TO   SSA-ADDR-KEY

CALL 'CBLTDLI' USING GU                   
                     CUSTMER-PCB           
                     SEG-ADDRESS           
                     SSA-CUSTOMER         
                     SSA-ADDRESS             

SSA:

01  SSA-CUSTOMER.                                           
    05  FILLER        PIC X(19) VALUE 'CUSTOMER(CUSTNO   ='.
    05  SSA-CUST-KEY  PIC 9(7).                             
    05  FILLER        PIC X     VALUE ')'.                 

01  SSA-ADDRESS.                                           
    05  FILLER        PIC X(19) VALUE 'ADDRESS(ADDRCODE  ='.
    05  SSA-ADDR-KEY  PIC 9(2).                             
    05  FILLER        PIC X     VALUE ')'.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue May 29, 2012 3:53 pm
Reply with quote

Did u write the FILLER from SSA- Customer as
Code:

05 FILLER PIC X(19) VALUE 'CUSTOMER(CUSTNO ='.


or
Code:

05 FILLER PIC X(19) VALUE 'CUSTOMER(CUSTNO   ='.


2nd is the valid one
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Tue May 29, 2012 4:10 pm
Reply with quote

Did you read about status-code AC and understood ?
Back to top
View user's profile Send private message
suvojyoti chowdhury

New User


Joined: 16 Dec 2011
Posts: 4
Location: India

PostPosted: Tue May 29, 2012 4:35 pm
Reply with quote

@Rajesh,
The length of the Filler in SSA is adjusted to 19 bytes.

@Peter

I have gone through the IBM manual and could find that the reason behind AC is:
1. If we give wrong sequence of SSA in a multiple segment serach.
2. If we dont give the segment name in the PCB.
3. Defining two PCBs for same hierarchic level.
4. If qualified SSA for dependent segment is being used while the primary database is being accessed with secondary indexing.
5. The segment name is in the DB PCB, but the qualification for the command does not specify it in its correct hierarchic sequence.

I am not sure for which reason my call is failing. Thats why I have given in detail decription for my program.

Could you please point out if I am missing anything.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Tue May 29, 2012 5:02 pm
Reply with quote

Have a look here: publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.ims10.doc.apg%2Fp3hqyc.htm
Use the same method (Table 1)when you construct your SSA, and you will not run into problems.
Display your SSA:s before use issue the calls, and you will see better what you really are using.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue May 29, 2012 5:31 pm
Reply with quote

I forgot the basics of 'PROCOPT=GP', whether we can use it on a lower lvl segment. Hence would like to throw the below stone. Can you try as below :-



Code:

CUSTMER  PCB   TYPE=DB,DBDNAME=PCUSTMER,KEYLEN=09           
         SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP           
         SENSEG NAME=ADDRESS,PARENT=CUSTOMER,[b] PROCOPT=G[/b]
         SENSEG NAME=ORDPTRSC,PARENT=CUSTOMER,PROCOPT=GD 
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue May 29, 2012 5:32 pm
Reply with quote

well, I mean

Code:

CUSTMER  PCB   TYPE=DB,DBDNAME=PCUSTMER,KEYLEN=09           
         SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP           
         SENSEG NAME=ADDRESS,PARENT=CUSTOMER,PROCOPT=G
         SENSEG NAME=ORDPTRSC,PARENT=CUSTOMER,PROCOPT=GD
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Tue May 29, 2012 5:42 pm
Reply with quote

Code:
01 SSA-Segname.
   05                   Pic X(08) Value 'SEGNAME'.
   05                   Pic X(01) Value '('.
   05                   Pic X(08) Value 'KEYNAME'.
   05                   Pic X(02) Value '='.
   05 Keyname-Val       Pic X(nn).   <---- change to length
   05                   Pic X(01) Value ')'.
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top