Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 -> COBOL Programming
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    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

CICS Guy

Senior Member


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

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

Site Director


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

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: 51
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

Active User


Joined: 11 May 2005
Posts: 344
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 Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
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: 52
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: 51
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

Site Director


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

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: 52
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

Site Director


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

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us