Yes, you can use SQL to convert numeric to alpha.
You need to use the CAST operand.
This instruction will take a 4 digit number and convert it to alpha and put in leading zeros.
repeat(”0”,4 – length( cast(Aagt as varchar (4)))) concat (cast(aagt as varchar (4)))
If you want to increares the length of the field you just concat ’00’ to the front of the field.
*
No, you can not do this over a “live” file.
Since you are changing a field in the file you will need to create the new file and then recompile all your programs that use that file. Then you can run the SQL statement to “move” the data from the old file to the new file.
Discuss This Question: 1  Reply