BookmarkSubscribeRSS Feed
konstantinokada
Calcite | Level 5

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;

 

 

 

1 REPLY 1

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1437 views
  • 0 likes
  • 2 in conversation