Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why can't display the S99V99 usage com-3 in the combination?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
linc

New User


Joined: 25 Aug 2008
Posts: 25
Location: china

PostPosted: Mon Sep 22, 2008 7:46 am    Post subject: Why can't display the S99V99 usage com-3 in the combination?
Reply with quote

Hi Guys :
Why I can't diplay the following tiems.
Code:

WORKING-STORAGE SECTION.                         
01  W-TEST.                                     
    05  W-TEST1       PIC S99V9 USAGE COMP-3.   
    05  FILLER                 PIC X(01).       
..
Procedure division.
MOVE ZERO TO W-TEST   
MOVE 34.1 TO W-TEST1
DIPLAY 'W-TEST1 IS '
W-TEST1   
DISPLAY 'W-TEST IS '   
W-TEST.                 


Then the W-TEST1 can display correctly,but the W-TEST can't display,its blank.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 22, 2008 8:36 am    Post subject:
Reply with quote

Hello,

Quote:
Why I can't diplay the following tiems.
Because you have incorrect code. Just because the code can compile does not mean that it can work.

The move zero to w-test is immediately undone by moving a value to w-test1.

When you display w-test1 you get the correct value because that is the field you most recently moved a value to. The value in w-test is not blank, but it is not displayable characters either.
Back to top
View user's profile Send private message
linc

New User


Joined: 25 Aug 2008
Posts: 25
Location: china

PostPosted: Mon Sep 22, 2008 8:40 am    Post subject:
Reply with quote

Thanks.I already solved this problem.After I moved this to a variable like
PIC -ZZ.9. Then display ,it works now.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 22, 2008 9:53 am    Post subject:
Reply with quote

Hello,

Good to hear it is working icon_smile.gif

From your original post, there was no indication that something was not working. It appeared you wanted clarification on the results you got with the posted code.

If something does not work the way you need, it is a good idea to be most clear on what you need to happen that does not happen. This
Quote:
Then the W-TEST1 can display correctly
sounds like it worked. . . (at least to me).

I mention this so that when other questions are posted, care is taken to make the info as complete as possible.

Thanks for using the "Code" tag for your posted code. It is much easier to read icon_wink.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Sep 22, 2008 7:13 pm    Post subject:
Reply with quote

Hi Linc,

When I display W-TEST I get:

Code:
 W-TEST IS   0
4E6ECEE4CE431F4
060352309204C00

not "blanks"

What you're getting is the Packed Decimal representation of 34V1 plus the low order zero resulting from the "MOVE ZERO"

When you DISPLAY a group field (W-TEST) no data conversion takes place; when you DISPLAY an elementary field (W-TEST1) the data is converted to display format.
Back to top
View user's profile Send private message
linc

New User


Joined: 25 Aug 2008
Posts: 25
Location: china

PostPosted: Mon Sep 22, 2008 7:24 pm    Post subject:
Reply with quote

mmwife wrote:
Hi Linc,

When I display W-TEST I get:

Code:
 W-TEST IS   0
4E6ECEE4CE431F4
060352309204C00

not "blanks"

What you're getting is the Packed Decimal representation of 34V1 plus the low order zero resulting from the "MOVE ZERO"

When you DISPLAY a group field (W-TEST) no data conversion takes place; when you DISPLAY an elementary field (W-TEST1) the data is converted to display format.
Thanks mmwife.That's an excellent explanation.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Sep 22, 2008 8:19 pm    Post subject:
Reply with quote

'welcum.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us