Hello,
I am new to SAS and this is my first time posting. I am having issues removing line breaks when importing a CSV to SAS. I have tried using TERMSTR=CRLF, I have also tried using TRANWRD and TRANSLATE without any success.
The code below is what I am using for the import and I have attached a screenshot of the export with the line break once the data has been manipulated.
DATA WORK.ACC ;
%LET _EFIERR_ = 0;
INFILE CSV DELIMITER = ',' MISSOVER DSD FIRSTOBS=2 ;
INFORMAT Customer_Number $10.;
INFORMAT Account_Name $50.;
INFORMAT Billing_Street $50.;
INFORMAT Billing_City $50.;
INFORMAT Billing_State_Province $2.;
INFORMAT Billing_Zip_Postal_Code $7.;
INFORMAT Amount_Outstanding DOLLAR11.2;
INFORMAT Account_Status $20.;
INFORMAT Debts DOLLAR11.2;
INFORMAT Shipping_Street $50.;
INFORMAT Shipping_City $50.;
INFORMAT Shipping_State_Province $2.;
INFORMAT Shipping_Zip_Postal_Code $7.;
INFORMAT Phone $14.;
INFORMAT Mobile_Phone $14.;
INFORMAT Fax $14.;
FORMAT Customer_Number $10.;
FORMAT Account_Name $50.;
FORMAT Billing_Street $50.;
FORMAT Billing_City $50.;
FORMAT Billing_State_Province $2.;
FORMAT Billing_Zip_Postal_Code $7.;
FORMAT Amount_Outstanding DOLLAR11.2;
FORMAT Account_Status $20.;
FORMAT Debts DOLLAR11.2;
FORMAT Shipping_Street $50.;
FORMAT Shipping_City $50.;
FORMAT Shipping_State_Province $2.;
FORMAT Shipping_Zip_Postal_Code $7.;
FORMAT Phone $14.;
FORMAT Mobile_Phone $14.;
FORMAT Fax $14.;
INPUT Customer_Number
Account_Name
Billing_Street
Billing_City
Billing_State_Province
Billing_Zip_Postal_Code
Amount_Outstanding
Account_Status
Debts
Shipping_Street
Shipping_City
Shipping_State_Province
Shipping_Zip_Postal_Code
Phone
Mobile_Phone
Fax;
RUN;
See the detailed explanation and solution here
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.