robert fuschetto Posted November 7, 2023 Share Posted November 7, 2023 I need to convert an INT master file column to an A20 in a DEFINE so I can Join it to another table.Integer values range from 1 - 999. No matter what I have tried the character conversion comes out wrong..typically leading zeros dissapear etc. I just want the number 1,2,3...10,11,12...100,101,102 etc. Link to comment Share on other sites More sharing options...
Patrick Huebgen Posted November 7, 2023 Share Posted November 7, 2023 DEFINE FILE CAR RCOST_A/A15 = FTOA(RCOST, '(D12.2)', RCOST_A); ALPHA_SALES/A20=EDIT2(SALES,'I11'); END TABLE FILE CAR BY HIGHEST SALES BY HIGHEST ALPHA_SALES BY HIGHEST RCOST BY HIGHEST RCOST_A BY COUNTRY END Link to comment Share on other sites More sharing options...
Brent Mason 2 Posted November 7, 2023 Share Posted November 7, 2023 DEFINE FILE ggsales UNITS_FORMAT/A20 = FPRINT(UNITS, 'I08'); END TABLE FILE ggsales PRINT UNITS UNITS_FORMAT END Link to comment Share on other sites More sharing options...
David Beagan Posted November 9, 2023 Share Posted November 9, 2023 Hi Robert, be aware that the examples above can have leading spaces in the A20 result, even though it might not look like it in the HTML output. These leading spaces can be a problem. You can explicitly either right justify or left justify the value of the A20 defined field to match the field you are joining to. You can use the RJUST or LJUST functions to do this.Documentation link: Using Functions Manual Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now