montypython1
Technical User
Greetings,
What is the best way to suppress a single space character within a given field (if it is the ONLY character within that field)?
I am exporting a file into CSV format, but can't seem to figure out how to suppress the single space character within the "MidName" field if there is NO middle name. Most of the records contain a value in this field, but the few that do not are causing an error when uploading this file to another system. I've tried using the ALLTRIM function, but it still inserts a single space in the "MidName" field. My code is pretty simple (see below):
************************************
SELECT SSN, FirstName, ALLTRIM(MidName) AS MiddleName, LastName, Wages_Qtr1, PITWG_Qtr1, TaxWH_Qtr1, WagePlan ;
FROM csrEmplData_Output2 ;
INTO CURSOR csrEmplData_Output3 NOFILTER
COPY TO "C:\Test\blankmiddleinit" TYPE CSV
************************************
I certainly appreciate any suggestions.
Thanks,
Dave Higgins
What is the best way to suppress a single space character within a given field (if it is the ONLY character within that field)?
I am exporting a file into CSV format, but can't seem to figure out how to suppress the single space character within the "MidName" field if there is NO middle name. Most of the records contain a value in this field, but the few that do not are causing an error when uploading this file to another system. I've tried using the ALLTRIM function, but it still inserts a single space in the "MidName" field. My code is pretty simple (see below):
************************************
SELECT SSN, FirstName, ALLTRIM(MidName) AS MiddleName, LastName, Wages_Qtr1, PITWG_Qtr1, TaxWH_Qtr1, WagePlan ;
FROM csrEmplData_Output2 ;
INTO CURSOR csrEmplData_Output3 NOFILTER
COPY TO "C:\Test\blankmiddleinit" TYPE CSV
************************************
I certainly appreciate any suggestions.
Thanks,
Dave Higgins