comp-3 in a txt file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

comp-3 in a txt file

Postby veronikaluv » Fri Feb 22, 2008 1:57 pm

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.
veronikaluv
 
Posts: 7
Joined: Sat Feb 16, 2008 10:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: comp-3 in a txt file

 

Re: comp-3 in a txt file

Postby arunprasad.k » Fri Feb 22, 2008 3:55 pm

arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: comp-3 in a txt file

Postby CICS Guy » Fri Feb 22, 2008 6:18 pm

veronikaluv wrote:in a txt file.
Huh? What platform are you trying to do this on?
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: comp-3 in a txt file

Postby dick scherrer » Fri Feb 22, 2008 8:52 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: comp-3 in a txt file

Postby CICS Guy » Fri Feb 22, 2008 11:32 pm

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.
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: comp-3 in a txt file

Postby CICS Guy » Sat Feb 23, 2008 12:18 am

values like +303030303....
BTW, that looks like a hex display of unpacked ASCII zeros......
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post