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

How to display comp-3 variable in SYSOUT


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

New User


Joined: 30 Nov 2005
Posts: 19
Location: India

PostPosted: Mon Jan 30, 2006 5:14 pm
Reply with quote

Hi all,
I want to know how we can display a comp-3 variable in SYSOUT?

Thanks & Regards,
Yogesh.
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Mon Jan 30, 2006 7:19 pm
Reply with quote

there is no direct way to display.

you define equivalent working storage variable and display that variable.
Ex:
01 filed1 pic s9(3) comp-3.
01 filed2 pic -z99.

move field1 to field2.
display 'data:' field2
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Mon Jan 30, 2006 9:42 pm
Reply with quote

Hi yogeshbabu,

raghunathns is very right..
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 31, 2006 5:13 am
Reply with quote

I think it should be mentioned that comp-3 #s diSplay well except for the 1 lowest order digit.

If you're using displays for testing it's probably not worth the effort to do the moves. I just display them the way they are and use the following table to get the lowest #:
Code:

 0 {or}
+1 A   -1 J   
+2 B   -2 K   
+3 C   -3 L   
+4 D   -4 M
+5 E   -5 N
+6 F   -6 O
+7 G   -7 P   
+8 H   -8 Q
+9 I   -9 R
Back to top
View user's profile Send private message
yogeshbabu

New User


Joined: 30 Nov 2005
Posts: 19
Location: India

PostPosted: Tue Jan 31, 2006 10:18 am
Reply with quote

Thanks a lot
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top