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

Sign clause in decima


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

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Wed Jul 28, 2010 2:11 pm
Reply with quote

Hi,
I have a variable "A" with a picture clause as S9(11)V99 COMP. I need to write this into a file in the format +/- S9(11).99 (i.e. the sign should be leading and a decimal sign should also be there).

Can someone help me to do this. I have one limitation - I cannot change the picture clause of A.

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 28, 2010 3:00 pm
Reply with quote

well,

you can have sign leading with datatype display, but not comp.
you can have a decimal sign with datatype alphanumeric
(after moving the contents of variable 'A' to a field defined with an edit mask)
but, you can not have a datatype comp with a decimal point physically contained in the comp variable

there is not need to change the picture clause of variable 'A'.
just define a field in your output file definition that contains an edit mask as the picture clause, move variable 'A' to this new field.

since most edit mask definitions (yes, you need to go to the manual),
contain provisions for only a + or -,
you may need extra code to insert the 'missing' sign.
but don't worry about that now, you will understand what I mean when
you have read the manual.
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 To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
No new posts NOT IN clause in COBOL pgm COBOL Programming 8
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts Typing the CENT sign ยข on mainframe,... All Other Mainframe Topics 2
Search our Forums:

Back to Top