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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.