Fixed-width field

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
KellyJ
Posts: 3
Joined: Tue Oct 10, 2017 12:44 pm

Fixed-width field

Post by KellyJ » Tue Sep 11, 2001 7:59 am

I^m creating a report, exporting to an ASCII file. I have a fixed-width field that is numeric, but with a strange twist. For example, if the number is 2578931452.36, the output should show 25789314523F. Something called ^signed conversion equivalents^. The last byte of the field is converted according to it^s sign. I have the conversion table, so I know what number needs to be converted to what character, but I^m having problems figuring the rest out. I^m using the R&R version that is bundled with Abra Suite, version 6.17. Any suggestions?____Thanks, __KellyJ

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Fixed-width field

Post by kfleming » Tue Sep 11, 2001 3:55 pm

You could use:____left(strrep(str(number,14,2),".",""),12)-CASE(right(str(number,14,2),1),"6","F","?")____but changing the last CASE() function to include the appropriate value for the remaining 9 digits.______Kathleen__R&R Support__

KellyJ
Posts: 3
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Fixed-width field

Post by KellyJ » Wed Sep 12, 2001 1:29 pm

Kathleen,____Thanks for the suggestion, it gave me the output I was looking for. But I have one more twist to add to this: how do I add a substr on this expression so I get output of exactly 10 characters, regardless of if the original field was 2 or 20 in length?____Kelly

Post Reply