Page 1 of 1

comp-3 in a txt file

PostPosted: Fri Feb 22, 2008 1:57 pm
by veronikaluv
Hi there!
I'm trying to insert a number 100.00 S9(13)V9(2) comp-3n in a txt file.
I have the record:
01 RECORD.
03 REC-TYPE PIC S9(2).
03 REC-TYPE10.
05 FILI PIC X(5).
05 CON PIC X(12).
03 REC-TYPE20 REDEFINES REC-TYPE10
05 CAUS PIC X(5).
05 IMP PIC S9(13)V9(2) COMP-3.
05 FILLER PIC (4).

When I make a physical .txt file on a hard disk, (to open it and read it), just to work with some examples, how do I need to write down the comp-3 value?
If CAUS has the value A (4blanks), IMP has the value 100,00, and filler are 4 spaces. In any way that I tried compiling it, I receive for imp the values like +303030303....
Thanks.

Re: comp-3 in a txt file

PostPosted: Fri Feb 22, 2008 3:55 pm
by arunprasad.k

Re: comp-3 in a txt file

PostPosted: Fri Feb 22, 2008 6:18 pm
by CICS Guy
veronikaluv wrote:in a txt file.
Huh? What platform are you trying to do this on?

Re: comp-3 in a txt file

PostPosted: Fri Feb 22, 2008 8:52 pm
by dick scherrer
Hello,

I'm trying to insert a number 100.00 S9(13)V9(2) comp-3n in a txt file.
COMP-3 (packed-decimal) is not valid in a "text file".

You can create a text file or you can create a file with packed-decimal data, but they will not be the same file.

If you explain the requirement, we can probably offer suggestions on how to proceed.

Re: comp-3 in a txt file

PostPosted: Fri Feb 22, 2008 11:32 pm
by CICS Guy
If just trying to get IMP equal to 100.00:
MOVE 100.00 TO IMP.
05 IMP PIC S9(13)V9(2) COMP-3 VALUE 100.00.

Re: comp-3 in a txt file

PostPosted: Sat Feb 23, 2008 12:18 am
by CICS Guy
values like +303030303....
BTW, that looks like a hex display of unpacked ASCII zeros......