SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
lmtamina
Obsidian | Level 7

Good Morning,

 

I exported a dataset with 2M obs into a csv or text file for our vendor. However, when they tried opening the file, the carriage return line feed is missing, so the file seems to be looping around continuously  . They were unable to parse the file as the expected CRFL at the need of each record is missing Please see example below with missing line feed between header ADDR and LastName. I tried exporting in comma, tab and Pipe delimiters and was not successful. I am setup on a SAS EG platform. Appreciate any assistance. Thank you as always.

 

LASTNAME|FIRSTNAME|DOB|AGE|ADDRDoe|John|1/1/1970|38|20 Street Drive

 

Below is the sample pipe delimiter proc export:

 

proc export data=TEST

outfile="%sysfunc(pathname(WORK))/TEST.txt"

dbms= dlm;

replace;

delimiter='|';

run;

6 REPLIES 6
Shmuel
Garnet | Level 18

I assume you have to assign DBMS = CSV.

 

Beyond, you have not mentioned which OS you use and which OS your vendor use.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Are you on a Unix based system, and them on a Windows system.  That is often the cause of mismatches in line endings.  Likely they will be using notepad to view the data.  If you use notepad++ or textpad they normally recognise the differences in line endings.  Also, importing the data you can use the termstr:

http://support.sas.com/kb/14/178.html

Can be used to alternate between them

lmtamina
Obsidian | Level 7

That is correct. I am on a Unix platform and I believe they are on Windows . Also, I  FTP' d  the a sample dataset in txt/csv file from Unix to my local Windows folder and tried to open it on Windows using basic Notepad and I also cannot see the line feed return.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

As I said, Notepad does not have the capability to distinguish the different line endings.  You need Notepad++ or Textpad or something like that which can recognise the different line endings.  Also, as I noted the temrstr can be used to import the file correctly.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 6 replies
  • 3339 views
  • 1 like
  • 3 in conversation