Author |
Message
|
Bravo |
Posted: Mon Jul 17, 2006 4:33 pm Post subject: Question on COBOL copybook. |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
Hi All,
Before starting the actual flow.I tested the copybook with DEPENDING ON clause importing to toolkit.
Code: |
01 MESSAGE-INPUT-AREA.
05 IDOC-NO PIC X(16).
05 STA-OF-IDOC PIC X(02).
05 SENDER-PORT PIC X(06).
05 INVOICE-CNT PIC 9(02).
05 RECORD OCCURS 1 TO 99 DEPENDING ON INVOICE-CNT.
10 NAME PIC X(10).
10 DEPT PIC X(06).
|
The interface worked perfectly.I looked the message using RFHUTIL against the copybook and the message varies based on the counter perfectly.
Then I created actual copybook for IMS transaction.
Code: |
01 REQ-MID.
05 WS-MSG-LLZZ PIC 9(04).
05 WS-TRANCODE PIC X(07).
05 WS-FIL1 PIC X(01).
05 WS-HEADER-DATA.
10 WS-OPTION PIC X(01) VALUE SPACES.
10 WS-SAP-LOGON PIC X(08) VALUE SPACES.
10 WS-SAP-INVC-NO PIC X(10) VALUE SPACES.
10 WS-SHIP-LOC PIC X(03) VALUE SPACES.
10 WS-CUST-NO PIC X(09) VALUE SPACES.
10 WS-AUTH-NAME PIC X(20) VALUE SPACES.
10 WS-REF-NO PIC X(15) VALUE SPACES.
10 WS-REF-DATE PIC X(06) VALUE SPACES.
10 WS-ATTN PIC X(20) VALUE SPACES.
10 WS-TO-ADDRESS.
15 WS-TO-ADDR-LN-1 PIC X(35) VALUE SPACES.
15 WS-TO-ADDR-LN-2 PIC X(35) VALUE SPACES.
15 WS-TO-CITY PIC X(20) VALUE SPACES.
15 WS-TO-ST PIC X(02) VALUE SPACES.
15 WS-TO-ZIP-CD PIC X(09) VALUE SPACES.
05 WS_FIL2 PIC X(01).
05 WS-COUNTER PIC 9(03).
05 WS-FIL3 PIC X(01).
05 WS-DETAIL-DATA OCCURS 1 TO 100 DEPENDING ON WS-COUNTER.
10 WS-LINE PIC X(03) VALUE SPACES.
10 WS-LINE-QTY PIC X(08) VALUE SPACES.
10 WS-ITEM PIC X(25) VALUE SPACES.
10 WS-ON-HAND-INDC PIC X(01) VALUE SPACES.
10 WS-UOM PIC X(02) VALUE SPACES.
10 WS-UNIT-AMT PIC X(15) VALUE SPACES.
10 WS-FIL4 PIC X(01).
|
The interface worked perfectly and I can see the entire data in RFHUTIL in character format.
Code: |
0000XXXXXX [IHello World 1
23TEST TESTING R
EF_NO REF_DAATTN
TO_ADDR_LN1
TO_ADDR_LN2
TO_CITY
STTOZIP [002[123QUANTITYITE
M_NO C124567890
[456QUANTITYITEM_NO
C124567890 [
|
But when I mapped thru the copybook it says
Code: |
Level Ofs Len Type Occ Variable Name Value
*****Occurs value below minimum - value = 0 minimum = 1
01 0 210 REQ-MID
05 0 4 NUMB WS-MSG-LLZZ 0000
05 4 7 CHAR WS-TRANCODE XXXXXX
05 11 1 CHAR WS-FIL1 [
05 12 193 WS-HEADER-DATA
10 12 1 CHAR WS-OPTION I
10 13 8 CHAR WS-SAP-LOGON Hello
10 21 10 CHAR WS-SAP-INVC-NO World
10 31 3 CHAR WS-SHIP-LOC 123
10 34 9 CHAR WS-CUST-NO TEST
10 43 20 CHAR WS-AUTH-NAME TESTING
10 63 15 CHAR WS-REF-NO REF_NO
10 78 6 CHAR WS-REF-DATE REF_DA
10 84 20 CHAR WS-ATTN ATTN
10 104 101 WS-TO-ADDRESS
15 104 35 CHAR WS-TO-ADDR-LN-1 TO_ADDR_LN1
15 139 35 CHAR WS-TO-ADDR-LN-2 TO_ADDR_LN2
15 174 20 CHAR WS-TO-CITY TO_CITY
15 194 2 CHAR WS-TO-ST ST
15 196 9 CHAR WS-TO-ZIP-CD TOZIP
05 205 1 CHAR WS-FIL2 [
05 206 3 NUMB WS-COUNTER 002
05 209 1 CHAR WS-FIL3 [
Copy book size 210, Data area size 320
*** Data length does not match copybook
|
Just to make sure,I changed the layout of copybook from DEPENDING on to OCCURS 2 TIMES to check layout in RFHUTIL.It populated correctly.
Am I missing something??.
Please let me know your suggestion. _________________ Bravo |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 18, 2006 2:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
05 WS-DETAIL-DATA OCCURS 1 TO 100 DEPENDING ON WS-COUNTER. |
Now if WS-COUNTER = 0 you are in violation of the contract(copy book). This is what the message is telling you. You need to have at least 1 occurrence.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqmaniac |
Posted: Tue Jul 18, 2006 7:07 am Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
|
Back to top |
|
 |
Bravo |
Posted: Tue Jul 18, 2006 11:22 am Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
fjb_saper and mqmaniac thanks for the response.
I am making sure that WS-COUNTER will have number of occurance and I am not familar with COBOLDATA. I went thru the document and this supportpac is useful to put the data into the queue.
My case is to map the output data with copybook from queue.
Code: |
*****Occurs value below minimum - value = 0 minimum = 1
|
what is the reason for this in RFHUTIL?.
Any thoughts. _________________ Bravo |
|
Back to top |
|
 |
Bill.Matthews |
Posted: Tue Jul 18, 2006 1:12 pm Post subject: |
|
|
 Master
Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired)
|
Bravo wrote: |
fjb_saper and mqmaniac thanks for the response.
I am making sure that WS-COUNTER will have number of occurance and I am not familar with COBOLDATA. I went thru the document and this supportpac is useful to put the data into the queue.
My case is to map the output data with copybook from queue.
Code: |
*****Occurs value below minimum - value = 0 minimum = 1
|
what is the reason for this in RFHUTIL?.
Any thoughts. |
Go back and read fjp-snapper's answer - the copybook says OCCURS 1 to ... -- therefore a count of zero is an invalid condition. _________________ Bill Matthews |
|
Back to top |
|
 |
Bravo |
Posted: Tue Jul 18, 2006 3:39 pm Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
Bill
WS-COUNTER is not zero as I posted early.Here is the message which I am trying to map
0000XXXXXX [IHello World 1
23TEST TESTING R
EF_NO REF_DAATTN
TO_ADDR_LN1
TO_ADDR_LN2
TO_CITY
STTOZIP [002[123QUANTITYITE
M_NO C124567890
[456QUANTITYITEM_NO
C124567890 [
Code: |
01 REQ-MID.
05 WS-MSG-LLZZ PIC 9(04).
05 WS-TRANCODE PIC X(07).
05 WS-FIL1 PIC X(01).
05 WS-HEADER-DATA.
10 WS-OPTION PIC X(01) VALUE SPACES.
10 WS-SAP-LOGON PIC X(08) VALUE SPACES.
10 WS-SAP-INVC-NO PIC X(10) VALUE SPACES.
10 WS-SHIP-LOC PIC X(03) VALUE SPACES.
10 WS-CUST-NO PIC X(09) VALUE SPACES.
10 WS-AUTH-NAME PIC X(20) VALUE SPACES.
10 WS-REF-NO PIC X(15) VALUE SPACES.
10 WS-REF-DATE PIC X(06) VALUE SPACES.
10 WS-ATTN PIC X(20) VALUE SPACES.
10 WS-TO-ADDRESS.
15 WS-TO-ADDR-LN-1 PIC X(35) VALUE SPACES.
15 WS-TO-ADDR-LN-2 PIC X(35) VALUE SPACES.
15 WS-TO-CITY PIC X(20) VALUE SPACES.
15 WS-TO-ST PIC X(02) VALUE SPACES.
15 WS-TO-ZIP-CD PIC X(09) VALUE SPACES.
05 WS_FIL2 PIC X(01).
05 WS-COUNTER PIC 9(03).
05 WS-FIL3 PIC X(01).
05 WS-DETAIL-DATA OCCURS 1 TO 100 DEPENDING ON WS-COUNTER.
10 WS-LINE PIC X(03) VALUE SPACES.
10 WS-LINE-QTY PIC X(08) VALUE SPACES.
10 WS-ITEM PIC X(25) VALUE SPACES.
10 WS-ON-HAND-INDC PIC X(01) VALUE SPACES.
10 WS-UOM PIC X(02) VALUE SPACES.
10 WS-UNIT-AMT PIC X(15) VALUE SPACES.
10 WS-FIL4 PIC X(01).
|
WS-COUNTER is 2.The above message is in character format in RFHUTIL. _________________ Bravo |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 19, 2006 2:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If your format is right until state pic x(2)
according to your copy book your counter is "[12"
and by no way 002.
Remember Zip is defined as pic x(9). + 1 char for the filler (value=2)
So really the WS-COUNTER cannot be evaluated correctly....
You might want to check what happens upon serialization if the string being passed to the field is less than the field definition. Make sure the padding is set up right when you import the copy book.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Bravo |
Posted: Mon Jul 24, 2006 5:27 pm Post subject: |
|
|
Centurion
Joined: 03 Oct 2005 Posts: 146
|
fjb_saper thanks for the response and effort you have taken.
I resolved the problem.The copybook layout in wordpad which i used to map in RFHUTIL had tab space.I removed the tab space for couple of fields and split the depending on clause into two lines.
Well the changes is so starnge but it worked.
Code: |
From:
05 WS-DETAIL-RECORD OCCURS 1 TO 100 DEPENDING ON WS-COUNTER.
To:
05 WS-DETAIL-RECORD OCCURS 1 TO 100
DEPENDING ON WS-COUNTER.
|
_________________ Bravo |
|
Back to top |
|
 |
|