View previous topic :: View next topic
|
Author |
Message |
Rjadeja
New User
Joined: 18 Feb 2008 Posts: 9 Location: Mumbai
|
|
|
|
Hi All,
I am using eazytrive db2 porgram to do some type of impact analysis. i have amount in input file in decimal where as amount in table is packed decimal. Can I compare decimal (N) with packed decimal (P). If not how can i convert decimal to packed decimal ie.e N to P. Its urgent. Thanks for your help.
Can I convert A to N/P in eazytrive. If so how ????
Thanks,
R |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
If this is urgent have you looked int the eazytrive manual? I don't use eazytrive but if I did that is where I would look! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
After being here more than 3 years you must know that we don't do urgent. . .
Quote: |
Can I convert A to N/P in eazytrive. |
What does this mean?
Quote: |
Can I compare decimal (N) with packed decimal (P). |
Why might you believe you cannot . . .
If this is urgent, why did you not just run a few tests and see what happens. If you are looking for something from the forum, suggest you run the tests now and post anything unexpected or confusing that happens. Show the variable definitions, the code and the output. Someone will be able to help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Rjadeja wrote: |
Hi All,
I am using eazytrive db2 porgram to do some type of impact analysis. i have amount in input file in decimal where as amount in table is packed decimal. Can I compare decimal (N) with packed decimal (P). If not how can i convert decimal to packed decimal ie.e N to P. Its urgent. Thanks for your help.
Can I convert A to N/P in eazytrive. If so how ????
Thanks,
R |
These are very basic questions and, as has been pointed out, easily yield answers with very simple tests.
If you are unsure of these steps with Easytrieve, is it really the best tool for you to use for an "urgent" "impact analysis" of some sort?
You are in danger of spending time getting to know Easytrieve, rather than doing your analysis, with always the question "is it right, or is it something in the language I don't understand".
You have Cobol on your profile, why don't you do it in that, if you are so unsure of Easytrieve, or get the task allocated to someone who knows the product?
Yes, comparing N to P is no problem, just like Cobol. If you want to "convert" them, just do an assignment.
If Q is packed and P is zoned, the packed value of P now exists in Q. No need to do it, the compiler will allow you to do a direct comparison.
The A is a bit like X in Cobol, but also a bit like A in Cobol. If you have a field defined as A, and it always contains numbers, redefine it as N and test it for NUMERIC before using it. If you want to try assinging an A field to an N field, just try it. Then do the redefines.
Now, the intricacies. Which is correct for your data? NO1 or NO2?
Code: |
S-ALPHANUM-FIELD S 10 A
S-NUMERIC-NO1 S-ALPHANUM-FIELD 10 N
S-NUMERIC-NO2 S-ALPHANUM-FIELD 10 N 0 |
If you are writing reports, which, if any, of your fields should be S-type and which W-type storage?
If you keep everything absolutely really simple, you might be able to do it. Any complexity to the analysis and I think you'd be better off not trying to learn Easytrieve at the same time. |
|
Back to top |
|
|
Rjadeja
New User
Joined: 18 Feb 2008 Posts: 9 Location: Mumbai
|
|
|
|
Hi Bill,
Thanks for your help !!!!. I can not do it cobol as I fecthing data from production database and will not have access to read. Easytrive is best solution in this situation.
Hi All,
I did in this and it worked.
I declared one more wokring storage variable with packed decimal
lets say I
I W 8 P 0
My file variable is A
A 10 20 15 N.
I am using I=A and used I in my query to fetch details from table and it worked and results are expected. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Good for you.
I assume you mean
Code: |
A 10 15 N 0
or
A 20 15 N 0
as
A 10 20 15 N 0
is not valid |
You can do it in Cobol. You would just need to promote it to Production after testing was completed.
For me, you should now make sure your Easytrieve is placed in a production source library. You don't want someone coming along at year-end and wanting to know about your analysis and you are unable to find the code, or it has been changed to do something else since. CYA. Just finish it off properly (hey, maybe you even have already?). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|