Fill Character field with spaces
-
- Posts: 1
- Joined: Tue Oct 10, 2017 12:44 pm
Fill Character field with spaces
I have created a report for EXPORT which has the employees name at the end of the record. The system we will be transmitting the data to wants a 19 character field at the end of the record, with spaces to fill the field. The total record length is 132.____I have a field defined as EMPNAME and the calculation of:__RTRIM(P_LNAME) + ", " + P_FNAME____When I run the query it constantly removes all trailing spaces making the record a variable length record. In properties for the field I have set the length to 19 characters.____I am using R&R 6.5, but have XBASE 8.1 available if needed.____Thank you for your help.
-
- Posts: 2
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Fill Character field with spcs
i have gotten around r&r^s propensity to trim fields despite my best efforts to tell it not to by doing something along these lines:____fieldname space(##-len(fieldname))____where you replace ## with the number of spaces that you wish the field to have.
=> RE: Fill field with spaces
[updated:LAST EDITED ON Sep-12-02 AT 05:05 PM (EST)]I created a calcuated __rtrim(first_name)+" "+ rtrim(last_name) = name____I then wrote another calulated field__iif(len(name) < 19, name+space(19-len(name)),substr(name,1,19))____It gave me a length of 19 every time. Note that at the end, if the name field is greater then 19, I only show the first 19 positions.__