Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Can I evaluate comp-3 values?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 25
Location: Bangalore,India

PostPosted: Sun Aug 24, 2008 5:14 pm    Post subject: Can I evaluate comp-3 values?
Reply with quote

Hi,

I have one douobt. I need to evalute on S9(7) COMP-3 value and based on that i have to move a new value to the same value.
My doubt is can directly evaluate the comp-3 variable or shall i need to convert that variable to 9(7)?

Please advice.

Thanks,
Harsha
Back to top
View user's profile Send private message
References
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1199
Location: At my desk

PostPosted: Sun Aug 24, 2008 7:04 pm    Post subject:
Reply with quote

What do you mean 'evaluate'?
As far as I know, anything you can do with with ZD you can do with PD.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8771
Location: 221 B Baker St

PostPosted: Sun Aug 24, 2008 8:17 pm    Post subject:
Reply with quote

Hello,

Did you try it? What happened?

Did you look in the manual?
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr10/6.2.13.2?
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 25
Location: Bangalore,India

PostPosted: Mon Aug 25, 2008 11:33 am    Post subject:
Reply with quote

yes i did a try its working but soem my team members told me to move the variable to soem numeric then evaluate the same. But really didn't know the reason why they asked me to do.
Back to top
View user's profile Send private message
acevedo

Senior Member


Joined: 11 May 2005
Posts: 318
Location: Spain

PostPosted: Mon Aug 25, 2008 12:38 pm    Post subject:
Reply with quote

then you should ask them why, and tell them that you tried and it's working!
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2241
Location: Mumbai, India

PostPosted: Mon Aug 25, 2008 12:38 pm    Post subject:
Reply with quote

Hi,

You can use EVALUATE statement on numeric values, COMP-3 is just other way to represent numeric values, so yes you can
Quote:
directly evaluate the comp-3 variable

BTW, I didn't get this
Quote:
have to move a new value to the same value
are you re-writing the file, probably little more explanation is needed.

Quote:
But really didn't know the reason why they asked me to do.
Oh.. ask again then..
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 29
Location: chennai

PostPosted: Mon Aug 25, 2008 5:12 pm    Post subject: Reply to: Can I evaluate comp-3 values?
Reply with quote

Hi,

You can do all the evaluation on Comp-3 fields. The only situation where you need to convert them to Zoned decimal is, when you FTP them to your machine in ASCII mode. In all the other cases, you can directly evalute a COMP-3 field.
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 25
Location: Bangalore,India

PostPosted: Mon Aug 25, 2008 7:03 pm    Post subject:
Reply with quote

Thanks a lot for all you replys. i asked them why should i move the comp value to numeric then they told while running the program in production to be safer side they asked me to use numeric value for checking but still i didn't satisfy with their justification.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8771
Location: 221 B Baker St

PostPosted: Mon Aug 25, 2008 11:18 pm    Post subject:
Reply with quote

Hello,

Quote:
they told while running the program in production to be safer side
They are mistaken. It is no safer using the "other" field.

Quote:
The only situation where you need to convert them to Zoned decimal is, when you FTP them to your machine in ASCII mode.
Definitely not. If you are going to ftp mainframe-created numeric data to some ASCII system, you do not want Zoned Decimal. Zoned decimal places the sign in the least significant digit and this is not usable on ASCII systems. To transfer numerics to an ASCII system, an edited value with the sign is a better choice (i.e. AN-EDITED-VALUE PIC 99999-).
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 29
Location: chennai

PostPosted: Tue Aug 26, 2008 10:59 am    Post subject: Reply to: Can I evaluate comp-3 values?
Reply with quote

Ya. We will convert the packed decimal to numeric edited field only. I wrongly conveyed it as zoned decimal. Sorry for the mistake and thanks for the correction.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8771
Location: 221 B Baker St

PostPosted: Tue Aug 26, 2008 11:05 am    Post subject: Reply to: Can I evaluate comp-3 values?
Reply with quote

You're welcome icon_smile.gif

d
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1