Joined: 10 Mar 2016
| 0 votes |
| 0 salutes ||
|Posted: Thu Mar 10, 2016 5:12 am Post subject: Complex display to COMP-3 conversion
|Please bear with me. I am new to the group. I am working on converting a mainframe CICS process from importing and processing data via NJE to doing using SOAP in a straight mainframe-to-mainframe process.
I need to take an imported PIC X(7478) SOAP string and convert it first into multiple fields - some string and some COMP-3 - and then convert it back into a PIC X(6805) [where the difference in length is due to the COMP-3 values and so that it can then be processed internally]. Additionally this string includes group values that have to be worked through.
Earlier portions of the SOAP string tell me if the string contains a claim record, a payment record group, a wage group, or a help group. I am showing the following code for the claim record because it does not contain any group logic, but does show the issues I am having converting the string to COMP-3.
IF R0REC1-S > 0 [there is a field to tell me if a claim record is present]
MOVE REST-S(1:215) TO CLAIM-ITEM [see record definitions below]
MOVE CLAIM-ITEM TO CLAIM-ITEM-C
STRING REST-S(216:) DELIMITED BY SIZE
INIT DELIMITED BY SIZE [INIT is a defined string of spaces]
MOVE REMAINDER TO REST-S
(Since I know where the records lay and if they are present, I remove the portion REST-S processed, into REMAINDER with a string of initializing spaces) ...Proceeds onto processing the remaining group record types.
Then, once all the records have been converted as needed to COMP-3, they are all strung back together.
However, the resulting string still shows up in display format.
(The following two records display the issue.)
The first record was imported via the current NJE system and does not display the COMP-3 values.
The second was imported with SOAP, but is still displaying everything in text.
My question, since I am relatively new to COBOL processing...
Am I doing the basic conversion of string to numeric to COMP-3 correctly?
To get the data to populate correctly do I have to convert each field separately (i.e. for instance, moving Type, then moving Last, ...) rather trying to use a single move to the parent CLAIM-ITEM.
TYPE PIC X(01).
LAST PIC X(23).
FIRST PIC X(12).
MID PIC X(01).
ADDR1 PIC X(35).
ADDR2 PIC X(35).
CITY PIC X(19).
STATE PIC X(02).
ZIP PIC X(09).
EFF PIC 9(07).
BYE PIC 9(07).
CURPGM PIC X(03).
LLON PIC 9(07).
DQFM PIC 9(07).
DQTO PIC 9(07).
OP PIC 9(05)V99.
BAL PIC 9(05)V99.
WBA PIC 9(03).
MBA PIC 9(05).
EB PIC 9(07).
TRA PIC 9(07).
EXT PIC 9(07).
CLAIM-ITEM-C is the exact same layout except that the
straight 9(*) numeric fields are defined as 9(*) COMP-3 fields.
Thank you so much for your assistance.
Joined: 02 Oct 2006
| 0 votes |
| 0 salutes ||
|Posted: Mon Mar 14, 2016 7:55 pm Post subject:
|If you know the import format, have you looked at the COBOL UNSTRING Statement.
it was developed for this very purpose.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.