View previous topic :: View next topic
|
Author |
Message |
suvojyoti chowdhury
New User
Joined: 16 Dec 2011 Posts: 4 Location: India
|
|
|
|
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 |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
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 |
|
|
suvojyoti chowdhury
New User
Joined: 16 Dec 2011 Posts: 4 Location: India
|
|
|
|
Hi Rajesh,
I tried..but still got the same result.. |
|
Back to top |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
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 |
|
|
suvojyoti chowdhury
New User
Joined: 16 Dec 2011 Posts: 4 Location: India
|
|
|
|
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 |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
Did you read about status-code AC and understood ? |
|
Back to top |
|
|
suvojyoti chowdhury
New User
Joined: 16 Dec 2011 Posts: 4 Location: India
|
|
|
|
@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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
Back to top |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
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 |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
|