|
Charles Wilt wrote:
I've got a need to enable the CPYF using the FROMKEY/TOKEY
parameter with a signed numeric key when one specific file is
being copied. The call to CPYF is being done in a vendor's
program.
Basically, the vendor's program will do
CPYF FROMFILE(LIB1/MYFILE) TOFILE(LIB2/MYFILE)
FROMKEY(1 -100) TOKEY(1 -100)
I'm thinking that QIBM_QCA_CHG_COMMAND may be my answer.
I can build an exit program that check to see if CPYF is being
used on MYFILE with the FROMKEY and TOKEY parameters. If so, I
could invoke a custom written program to copy the appropriate
records.
I really do not understand the intention as described. Does that
mean to imply that there is no access to the vendor program to
correct their invocation? Why not just ask the vendor to correct
their program?
I'd set the vendor software up so that it passed the value as
character
CPYF FROMFILE(LIB1/MYFILE) TOFILE(LIB2/MYFILE)
FROMKEY(1 '-100') TOKEY(1 '-100')
So there is some ability to change the software.?
Does anybody see any possible issues with this?
I do not expect the character string value '-100' to function any
better than the value -100 [treated as numeric value]. The former
is a character string x'60F1F0F0' which is not even valid BCD
numeric data, and the latter is presumably passed to the CPP of the
CPYF as x'000000010000000D' and then utilized as a binary string of
the length-in-bytes of the field.
I believe the desired
specification is FROMKEY(*BLDKEY (-100)) TOKEY(*BLDKEY (-100)).
IIRC the non-*BLDKEY /key/ values for numeric types must be
specified using hex notation to match the internal representation of
the numeric data type & length. For example, by using x'123D' for a
P(3,1) column to select the key values of -12.3 from the key. But
even that is problematic as I recall, because the character value
for the FROMKEY() and TOKEY() are treated as binary strings instead
of being mapped to the internal type for any comparisons; e.g.
fromkey(1 x'100D') tokey(1 x'000F') may yield no results for an
ascending key, because the CPYF dismisses the illogical selection.?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.