DATA Step, Macro, Functions and more

Problem - Proc export to csv file - file suddenly makes weird lineshifts

Reply
Senior User
Posts: 1

Problem - Proc export to csv file - file suddenly makes weird lineshifts

The code below has worked for a couple of months. Today it suddenly makes weird lineshifts in the output. (and it is not because the file is that big)

 

proc export data=fdtdwh.t_AUM_DETAILS

    outfile='\\s64q600\Eisam\COGNOS\DATA\CSV data files\t__AUM_DETAILSxxx.CSV'       dbms=csv

    replace;

run;

 

I attached a picture of the output.. I have never experienced this before, neither have my colleagues.. Please help quickly

I have tried to rename the output and delete the existing csvfile - nothing worked..

 

I am using SAS EG ver7.1

Super User
Posts: 10,574

Re: Problem - Proc export to csv file - file suddenly makes weird lineshifts

Inspect the csv with a proper text editor (notepad++ or similar). Use hex display if normal text does not immediately give you a clue.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Super User
Posts: 9,840

Re: Problem - Proc export to csv file - file suddenly makes weird lineshifts

I would say your source data contains special characters.  We had this with one of our database providers, entry people were putting returns and tabs in the data entry fields and the database was not stripping them out.  So export ran fine for a while, then someone entered a return character and suddenly export broke.

Look for '0A'x, '0D'x, for instances of line feed carriage returns for instance.

Trusted Advisor
Posts: 2,127

Re: Problem - Proc export to csv file - file suddenly makes weird lineshifts

Ditto RW9's comments.  I've had this happen more than once with .csv files that were exported from Excel.  Inspect the input file.

Super User
Posts: 13,941

Re: Problem - Proc export to csv file - file suddenly makes weird lineshifts


Doc_Duke wrote:

Ditto RW9's comments.  I've had this happen more than once with .csv files that were exported from Excel.  Inspect the input file.


I would bet a small stack of quarters that your data originated as Excel or other spreadsheet and has cells someone used "ctrl enter" to create multi-line data in text.

Ask a Question
Discussion stats
  • 4 replies
  • 215 views
  • 0 likes
  • 5 in conversation