Hi - I'm wondering if there is a cleaner way to convert Numeric fields to Alpha (with leading zeros).
I'm appending 2 tables, and am changing a lot of fields so they'll all be formatted the same in both tables.
Here's my current version, which works, but for larger fields, would be cumbersome.
example:
territory = 051
terr would = " 51" (although looks like "51 " on monitor!)
after IF's, terr = 051
Thanks in advance!
I'm appending 2 tables, and am changing a lot of fields so they'll all be formatted the same in both tables.
Here's my current version, which works, but for larger fields, would be cumbersome.
Code:
FORMAT TERR $3.;
TERR = TERRITORY;
IF SUBSTR(TERR,1,1) = ' ' THEN SUBSTR(TERR,1,1) = '0';
IF SUBSTR(TERR,2,1) = ' ' THEN SUBSTR(TERR,2,1) = '0';
IF SUBSTR(TERR,3,1) = ' ' THEN SUBSTR(TERR,3,1) = '0';
example:
territory = 051
terr would = " 51" (although looks like "51 " on monitor!)
after IF's, terr = 051
Thanks in advance!