I have a display file field which is of type 7A. I am entering value as 18 to that field. Now I need to go to a file with this field as the keyfield. But in the file the value is stored as '00000018'. So if I chain with ' 18' it says value is not in file. Please help
Software/Hardware used:
ASKED:
December 6, 2012 9:48 AM
Why define it as 7A if all numeric digits are significant? Define it as a 7-digit zoned decimal instead of characters. — Tom
display file allows field to be as right-adjust, zero-filled
Looks like you display has it as alpha as well as your database file. If you do not want the leading zeros in the alpha field use the CHECK(RB) in the dspf. If you want to preserve the leading zeros the use CHECK(RZ). Then you just match your key field to the format you select.
step1: Move the screen field(lets assume Dsvar (7A)) to standalone Field (lets assume Wkvar (7s0)) Ex: Wkvar = %char(Dsvar); // Wkvar = 0000080Step2: Move the standalone Field to Screen field using Editc and chain to file Ex: Dsvar = %EditC(Wkvar : ‘X’); //Dsvar =’0000080′