View previous topic :: View next topic
|
Author |
Message |
vardhan0007
New User
Joined: 05 Jun 2006 Posts: 51 Location: Bangalore,India
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
vardhan0007
New User
Joined: 05 Jun 2006 Posts: 51 Location: Bangalore,India
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
then you should ask them why, and tell them that you tried and it's working! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
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 |
|
|
vardhan0007
New User
Joined: 05 Jun 2006 Posts: 51 Location: Bangalore,India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Selva-kumar
New User
Joined: 01 Mar 2007 Posts: 52 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
d |
|
Back to top |
|
|
|