IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Display the contents in comp and comp3 fields


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
baramesh

New User


Joined: 20 May 2008
Posts: 25
Location: bangalore

PostPosted: Mon Jun 02, 2008 9:45 am
Reply with quote

Hi Forum,

Iam working on a report generation module.I have problem, I need to display the contents in comp and comp3 fields which are described below.

01 countrs- subscrts
02 usub1 pic s9(4) comp value


01 imdt -rslts
02 int-sum pic s9(5)v(2) comp3

Please suggest me the equivalent variabbles with display usage.

Thevalue in comop is -5634 and in comp3 is -9999999.
Back to top
View user's profile Send private message
chandu.be

New User


Joined: 17 Jul 2006
Posts: 9
Location: Bagalore

PostPosted: Mon Jun 02, 2008 11:34 am
Reply with quote

Hi,

For reporting purpose always it is suggestable to use editing variables.

For your requirement you can use the following type variables:

1. To display the value of COMP you can use 'PIC -9(4)' variable.
2. To display the value of COMP-3 you can use 'PIC -9(3).9(2)' variable.
Note that -99999 value will be displayed as -999.99



Regards,
Chandu
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Mon Jun 02, 2008 11:38 am
Reply with quote

Hi,

Code:

For reporting purpose always it is suggestable to use editing variables.

For your requirement you can use the following type variables:

1. To display the value of COMP you can use 'PIC -9(4)' variable.
2. To display the value of COMP-3 you can use 'PIC -9(3).9(2)' variable.
Note that -99999 value will be displayed as -999.99


Adding to above, just move the COMP variable to a equivalent local W-S variable or to report variable and display as you wish.
Back to top
View user's profile Send private message
baramesh

New User


Joined: 20 May 2008
Posts: 25
Location: bangalore

PostPosted: Mon Jun 02, 2008 4:50 pm
Reply with quote

Thank you every body for your valuable contributions.its working fine.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts How to display the leading zeros of a... DB2 7
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
Search our Forums:

Back to Top