Author |
Message
|
547c547 |
Posted: Mon Oct 13, 2014 2:12 am Post subject: Doubts about parsing... the message |
|
|
 Acolyte
Joined: 16 Jun 2014 Posts: 51
|
Code: |
01 CGSI1120-COPY.
02 MESSAGE-HOLDER.
03 RECORD-ID PIC X(4). << -- Imaginary element
03 CUSTOMER OCCURS 1 TIMES.
04 FILE PIC X(4).
04 SENDER PIC X(5).
04 RECEIVER PIC X(5).
04 FILE-ID PIC X(8).
04 PROCESS-1 PIC X(6).
04 DATA PIC X(6).
04 LENGTH PIC X(5).
04 PROCESS-2 PIC X(6).
04 ROCESS-3 PIC X(6).
04 FILLER PIC X(99).
03 BODY-01 OCCURS 1 TIMES.
04 REC-TP PIC X(1).
04 RWS-NUM PIC X(8).
04 VND-PO-NUM PIC X(16).
04 INBD-DELY-DOC-NUM PIC X(16).
04 TRX-DT PIC X(8).
04 GOODS-MOVE-CD PIC X(2).
04 FILLER-1 PIC X(99).
04 BODY-03 OCCURS 999 TIMES.
05 R1 PIC X(1).
05 R NUM PIC X(8).
05 R-LINE PIC X(3).
05 CD PIC X(16).
05 CN -CD PIC X(5).
05 LOC-CD PIC X(4).
05 BATCH PIC X(10).
05 TP-CD PIC X(3).
05 QTY PIC 9(10).
05 UOM-CD PIC X(4).
05 ITEM-NUM PIC X(4).
05 FILLER-2 PIC X(82).
03 TRAILER OCCURS 1 TIMES.
04 FILE PIC X(4).
04 SENDER PIC X(5).
04 RECEIVER PIC X(5).
04 FILE-ID PIC X(8).
04 PROCESS-1 PIC X(6).
04 DATA PIC X(6).
04 LENGTH PIC X(5).
04 PROCESS-2 PIC X(6).
04 PROCESS-3 PIC X(6).
04 FILLER PIC X(99). |
this is the cobol file I am trying to build a message definition TO parse.. using multipart message technique..
Question :: Can I take an imaginary element as record id since I didnt find any common one??
2) Body has sub-part BODY-03, CAN I delete that and take as outer message..??
Please answer.. Will be waiting for your valuable suggestions? |
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 14, 2014 3:25 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Help me out...what is an 'imaginary element'? _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
547c547 |
Posted: Tue Oct 14, 2014 7:57 pm Post subject: |
|
|
 Acolyte
Joined: 16 Jun 2014 Posts: 51
|
I mean.. Since I didnt find any common element(in provided requirement) to place it as record id.. I took an imaginary element .. changed it intercept value as Message Identity |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Oct 15, 2014 5:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's only an imaginary element if you do not put it into the message model.
Once it's in the message model, it's a real element (well, depending on data type it might be an integral element).
Yes, you can alter a message model after building it from a copybook or other kind of imported data structure.
At some point, the message model you are using to create or parse a message has to actually completely match the data being sent or received by the external application. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 16, 2014 6:44 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Yes, you can have more than one element with 'Interpret element value' set to 'Message identity'. The parser will use the value of the most recently-encountered 'message identity' element when it resolves an embedded message. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
|