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

having a $ sign infront of the amount


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

New User


Joined: 07 Mar 2005
Posts: 2
Location: India, Kolkata

PostPosted: Wed Apr 13, 2005 11:17 am
Reply with quote

hi,

I'm getting a file which has the transaction amount in the following format
$-123.50. for that file to read i have a copy book for the transaction amount WS-TRAN-AMNT PIC $9(11)V99.

While reading the value am getting is 000000000



Can anyone please tell me how can i get rid of the problem.
Back to top
View user's profile Send private message
Niteshs

New User


Joined: 24 Mar 2005
Posts: 6

PostPosted: Wed Apr 13, 2005 12:50 pm
Reply with quote

the display you have provided is of 9 digits 000000000 but it is defined as $9(11)V99.

can you provide the full figure here.
Back to top
View user's profile Send private message
bidhanlaha

New User


Joined: 07 Mar 2005
Posts: 2
Location: India, Kolkata

PostPosted: Wed Apr 13, 2005 1:48 pm
Reply with quote

yes niteshs u r right, the display is also 13 digit

my actual problem is how can i read a value from a file having values like $-123.50
Back to top
View user's profile Send private message
Niteshs

New User


Joined: 24 Mar 2005
Posts: 6

PostPosted: Wed Apr 13, 2005 1:59 pm
Reply with quote

Move this to S9(11)V9 and see the results and let us know also
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Apr 17, 2005 10:36 pm
Reply with quote

Hi bidhanlaha,

You're probably long gone now, but a few words to you anyway. This may help others who post ques here.

I find it strange that we lost contact w/you when Niteshs asked you to try someting and let us know how it worked out.

In order to help we need a well defined unambiguous defintion of the problem. For example, you state the field length is 13 bytes, yet you show $-123.50 (7 bytes), as an example of the field contents. Does the field have leading spaces, trailing spaces? Or is it truly 7 bytes? If so, what are the lengths of the field in the other recs in the file? Could we be dealing w/a variable len file?

You also show the copybook field's PIC as $9(11)V99. Generally PICs w/a $ use a period (.) not a V for the decimal point. I ask myself if this is not another error. Who knows? The data provided should be exact copies of the data in question, using cut & paste, not re-typing that can be error prone and carry the prejudices of the author.

The pgming business is a detail oriented pursuit. If you're not willing to operate day to day at this level of detail I'm afraid you won't advance too far in the profession you've chosen.


So, in closing Bidhanlaha, the quality of the help you receive is in direct proportion to the quality of your input.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Apr 19, 2005 12:47 am
Reply with quote

Well said Jack!
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 Amount of days between two dates PL/I & Assembler 8
No new posts Adding a trailer with record count an... JCL & VSAM 4
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts Identify the value if the SUM of the ... SYNCSORT 4
Search our Forums:

Back to Top