What FIXFORM Format would be used to read in a field, that was Zoned on the MainFrame, that was a converted to a number with a leading sign (where the + is blank)?
That depends what you mean by "was converted to a number."
What platform is on now? What does it look like in a text editor? And how about in hex?
If you view it in a text editor and the number is readable (1234 looks like 1234, -1234 looks like -1234), then it's alpha (A). If this is the case, and the number is 9 characters long, then fixform it as A9. If the USAGE is I9 or P9 in the MFD of the DB you're loading it into, then FOCUS will convert it internally to the proper format in the load.
If you view it in a text editor and it's garbage characters, then we'd need to figure out how it's actually stored right now.
If you view it in hex, and the number 1234 appears as
F1 F2 F3 F4 (mainframe EBCDIC) or
31 32 33 34 (PC ASCII)
then it's also a good bet that it's alpha.
Let us know what platform and what the data looks like both in hex and in a text editor and I can give you a better idea how to define it.
Thanks Chris, we are going from EBCDIC on MVS to ASCII on NT. We converted the MVS Zoned fields to alpha with a character space in front of the number for the sign. So, on NT 1234 is Alpha as you surmised. Our original was FIXFORM Z8.2, so with what you are saying we should probably change the FIXFORM to A8 (we were trying F8.2 to no avail) and then the USAGE which i believe is P8.2 will take care of itself. Correct?
Correct. A8 would be the actual format of that field. And conversion of A8 to P8.2 will work fine in the load. FOCUS will store it in the db as a P4 ACTUAL internally.
So if your MFD has the field defined as P8.2, you should have no problems using A8 as the input format for the fixform.
When the FIXFORM Format is A8 and the USAGE in the MFD is P8.2 the Load disregards the implied decimal, and the value is loaded as a whole number. How can we get the load to honor the decimal?
Data -> b0200000 - where b is blank
comes in as -> 200000
not as -> 2000.00
Ah. I assumed you had a *real* decimal in the alpha field (e.g., -1234.56).
In your case, if you have and "implied" .2 decimal, you'll need to do a COMPUTE to divide the field by 100 before loading the field into the database.
Hope that helps.
Well, you can 'cheat' . Since you're going to a 'P' format, and your data has an implied decimal point, use 'Z' format on the fixform. With 'Z' format, you can specify where the implied decimal point is. For example, if my data is '01234, and my FIXFORM declares the field as 'field/Z5.2', it'll be read in as 12.34.
Of course, this assumes there are no leading signs on your value.
Just out of curiosity, how did you get the leading sign, but lose the decimal point?
|Powered by Social Strata|