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
 

 

display s9(5)v99 comp-3

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

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Fri Sep 05, 2008 12:05 pm    Post subject: display s9(5)v99 comp-3
Reply with quote

i need to display s9(5)v99 comp-3 variable which is declared in the file and when i am displaying the variable by moving it into a WS variable it is not showing correctly. Can anyone help out this issue it is urgent.

Thanks.
Back to top
View user's profile Send private message

ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Fri Sep 05, 2008 12:42 pm    Post subject:
Reply with quote

Hi,

The Working Storage Variable should have the same declaration as the file variable.

If You are doing soo, then if you display either file variable or Ws variable it should display correctly.

Check your declaration Part or post more details as declartion and variables .. etc.

Cheers
Ashwin
Back to top
View user's profile Send private message
umasankar.eee06

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Fri Sep 05, 2008 1:09 pm    Post subject:
Reply with quote

Hi ashwinreddy,

Here is complete details, I have a file in that one of the fields is declared as s9(5)v99 comp-3 , and copybook also having the same declaration. Just for checking I declared one ws variale with same declaration and displayed that. But I didt get the actual value having the file.
ex:
value in file is 1143.56
Output value is 000 011(i got)

Can u help me how can I declare in ws to get the currect value?


Thanks
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2165
Location: @my desk

PostPosted: Fri Sep 05, 2008 1:30 pm    Post subject:
Reply with quote

umasankar.eee06,

Try moving s9(5)v99 comp-3 variable to another variable defined as -9(5).99 and DISPLAY the latter one.

Thanks,
Arun
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 05, 2008 1:31 pm    Post subject:
Reply with quote

Having used cobol for 40 years I don't think we are getting the full explanation.
Back to top
View user's profile Send private message
umasankar.eee06

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Fri Sep 05, 2008 1:59 pm    Post subject:
Reply with quote

Hi arun,


Try moving s9(5)v99 comp-3 variable to another variable defined as -9(5).99 and DISPLAY the latter one.



I got soc7 error.
Back to top
View user's profile Send private message
umasankar.eee06

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Fri Sep 05, 2008 4:21 pm    Post subject:
Reply with quote

Hi all,
No one can solve my prob?????
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 05, 2008 4:41 pm    Post subject:
Reply with quote

If you got an oc7 then the s9(5)v99 comp-3 variable does not contain a valid comp-3 value!

Redefine the s9(5)v99 comp-3 variable as x(4), display the x(4) variable and view the log with hex on to see what is there!
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Sep 05, 2008 4:42 pm    Post subject:
Reply with quote

the output of this test

Code:
05 w-picture-in       pic s9(5)v99 comp-3.             
05 w-picture-out      pic -9(5).99.                     
***********************************************************     
    MOVE 1143,56              TO W-PICTURE-IN                   
    MOVE W-PICTURE-IN         TO W-PICTURE-OUT                 
    DISPLAY W-PICTURE-OUT                                       
    GOBACK.


is 00011.43.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Sep 05, 2008 4:45 pm    Post subject:
Reply with quote

yes, as Crag said...check the value of that field.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Sep 05, 2008 4:57 pm    Post subject:
Reply with quote

Quote:

Here is complete details, I have a file in that one of the fields is declared as s9(5)v99 comp-3 , and copybook also having the same declaration. Just for checking I declared one ws variale with same declaration and displayed that. But I didt get the actual value having the file.
ex:
value in file is 1143.56
Output value is 000 011(i got)

Can u help me how can I declare in ws to get the currect value?
Without seeing exactly what you've done, the answer to your question is no, we cannot help you. From the compile, post (in code format) the copybook variable definition, the working storage variable definition, and the PROCEDURE DIVISION statements you used to move and display the variable. Once we see this, we should be able to make some suggestions.
Back to top
View user's profile Send private message
umasankar.eee06

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Fri Sep 05, 2008 5:17 pm    Post subject:
Reply with quote

Copy Book Declaration
15 MDC01-LAST-COST PIC S9(5)V99 COMP-3.

WS Variable
77 OLAST-COST PIC S9(5)V99 COMP-3.

READ IMDC-FILE INTO MDC-RECORD

MOVE MDC01-LAST-COST TO OLAST-COST.
DISPLAY 'Cost:' OLAST-COST.

MDC record contains MDC01-LAST-COST field having value 1143.56 but in the sysout it is showing 000 001
Now Can you suggest me to display the value 1143.56 exactly in sysout
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 05, 2008 5:26 pm    Post subject:
Reply with quote

My guess would be that the actual record data does not match the copy book!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Sep 05, 2008 6:01 pm    Post subject:
Reply with quote

Change
Code:
77 OLAST-COST PIC S9(5)V99 COMP-3.
to
Code:
77 OLAST-COST PIC S9(5).99 SIGN LEADING SEPARATE.
and post the results.
Back to top
View user's profile Send private message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Fri Sep 05, 2008 6:08 pm    Post subject:
Reply with quote

HI

You can move the comp-3 variable to another variable which can be declared as z(5)v9(2). Display that . You are able to see that. Comp-3 varaiable can be displayed when it is in editable characters. I tried this is working. Corrections are welcome.
Back to top
View user's profile Send private message
umasankar.eee06

New User


Joined: 04 Sep 2008
Posts: 11
Location: chennai

PostPosted: Mon Sep 08, 2008 10:02 am    Post subject:
Reply with quote

Hi birdy,
It is working. Thank u. Thanks for every one for giving good suggestions.
Back to top
View user's profile Send private message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Mon Sep 08, 2008 10:52 am    Post subject:
Reply with quote

welcome
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 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
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 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


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