RATE THIS ANSWER
0
Click to Vote:
0
0
Last Answered:
May 7 2008 10:55 AM GMT
by Bvining
Hi,
You should be able to MOVE your character field to your binary field. You'll need to check that you don't have any invalid data before you do the move.
Regards,
Martin Gilbert.
--------------------------------------------------------------------------------
Just to expand on Martin's idea a little bit. The following (as is pointed out in his answer) will work:
fBinKeyFileif e k disk
dAlphaKey s 10 inz('0000000002')
c move AlphaKey Key
c Key chain BinKeyFile 01
c *in01 ifeq *off
c Data dsply
c else
c 'Not Found' dsply
c endif
c move '1' *inlr
c return
where BinKeyFile is defined as:
R RECORD
KEY 9B 0
DATA 50
K KEY
BUT there is an assumption being made here, namely that your alphanumeric 10 byte field is using leading zeroes as in the sample program. If, on the other hand, the key value comes into your program as '2 ' then MOVE will toss the '2' due to how 9B 0 fields are implemented. There are ways around this but I won't go into them on the assumption that your field is formatted as above.
To test add a record to BinKeyFile with a key of 2. Using inz('0000000002') as above the record is found on the chain operation. Using inz('2') the record is not found on the chain operation.
Bruce Vining