Zero compressed value to character conversion



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

Zero compressed value to character conversion

Postby rajnivas » Sun Mar 21, 2010 1:54 am

Hi All,

Could someone please help me out on conversion of Zero compressed value of the format Z(6)9.999 to character conversion.

thanks
Rajnivas
rajnivas
 
Posts: 3
Joined: Sun Mar 21, 2010 1:29 am
Has thanked: 0 time
Been thanked: 0 time

Re: Zero compressed value to character conversion

Postby dick scherrer » Sun Mar 21, 2010 2:24 am

Hello and welcome to the forum,

Someone may be able to help if you tell us what "Zero compressed value" means to you. . .

Where is this value? How is it defined? What value(s?) does it contain?

This does not indicate any kind of "compression" - Z(6)9.999
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Zero compressed value to character conversion

Postby rajnivas » Sun Mar 21, 2010 2:37 am

Hi

I want convert the below declared variable to character

02 XXXXX PIC Z(6)9.999

XXXXX is a value displayed on CICS screen. When i initialize the value it displays as 0.000 but the display should be blank when it is initialized that is it should be SPACES.

thanks
rajnivas
rajnivas
 
Posts: 3
Joined: Sun Mar 21, 2010 1:29 am
Has thanked: 0 time
Been thanked: 0 time

Re: Zero compressed value to character conversion

Postby dick scherrer » Sun Mar 21, 2010 6:14 am

Hello,

The mask you have specified forces the n.nnn result. . .

I'm not connected to a mainframe just now so i've not tested this. Suggest you try:
02 XXXXX PIC Z(6)9.999 BLANK WHEN ZERO.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Zero compressed value to character conversion

Postby rajnivas » Sun Mar 21, 2010 9:17 pm

Thanks alot... The suggestion you provided is working.
rajnivas
 
Posts: 3
Joined: Sun Mar 21, 2010 1:29 am
Has thanked: 0 time
Been thanked: 0 time

Re: Zero compressed value to character conversion

Postby dick scherrer » Sun Mar 21, 2010 9:25 pm

Good to hear it is working - thank you for letting us know :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post