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

Can I evaluate comp-3 values?


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

New User


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

PostPosted: Sun Aug 24, 2008 5:14 pm
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
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun Aug 24, 2008 7:04 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

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

Hello,

Did you try it? What happened?

Did you look in the manual?
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: 51
Location: Bangalore,India

PostPosted: Mon Aug 25, 2008 11:33 am
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

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Aug 25, 2008 12:38 pm
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 Dhawan

Superior Member


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

PostPosted: Mon Aug 25, 2008 12:38 pm
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: 52
Location: chennai

PostPosted: Mon Aug 25, 2008 5:12 pm
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: 51
Location: Bangalore,India

PostPosted: Mon Aug 25, 2008 7:03 pm
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 25, 2008 11:18 pm
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: 52
Location: chennai

PostPosted: Tue Aug 26, 2008 10:59 am
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Aug 26, 2008 11:05 am
Reply with quote

You're welcome icon_smile.gif

d
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top