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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.