It's been a long while since I have posted anything to lawsonguru.
I'm doing a little bit of COBOL development within Lawson v10.
I'm writing a custom program. I have a sort file and a csv file. In the sort file I have defined it in workdef with some fields are of type "Signed" with length 11.2 (for example.
In my custom program data is correctly being written to with the "+" or "-" sign on the fields in the sort file.
If I try to define the CSV file with a signed field, the field actually comes out with something like "303030303.03" for any value in that field. If I define it numeric type, positive numbers are written correctly but negative numbers are missing the "-" sign in the field.
What will actually work in terms of getting a signed field in a CSV file? I've gone through some reviewing COBOL manuals and such but it doesn't seem to work.
Any tips or advise would be greatly appreciated. I am looking on how to actually get a signed number value correctly defined and working with a CSV work file. I am trying to write a signed numberic value to a CSV work file.
Thanks in advance,
Roger
Yep, I agree, but the CSV values for the negative numbers are still coming out as:
303032323.93
For any number that is moved there, negative or not.
Example:
MOVE -13.55 TO WS-EXAMPLE.
MOVE WS-EXAMPLE TO WS-TEMP-EXAMPLE.
...
MOVE WS-TEMP-CSV-REC TO CSV-ZZ165CSV-REC.
PERFORM 800-WRITECSV-ZZ165CSV.
OPEN CSV FILE
DISPLAY CSV-EXAMPLE ---> 303032323.93
---------
Working Storage
02 WS-TEMP-CSV-REC
05 WS-EXAMPLE PIC S9(09)V99 VALUE ZEROES.
In the CSV work file definition I've got:
EXAMPLE SIGNED 11.2