BookmarkSubscribeRSS Feed
mndatagirl
Calcite | Level 5

I've written simple code to output a SAS dataset to a txt file. When I read the file back into SAS, there are incremental (mostly blank) records being added, from what I think are "goofy" characters that I can't see. How do I get SAS to ignore these characters when outputting the file? 

 

Output code: 

DATA _NULL_;
FILE "file:\output" delimiter='09'x DSD lrecl=60;
SET DATA;

PUT
@1 VAR1 $40.
@41 VAR2 10.
@51 VAR3 10.
;

RUN;

1 REPLY 1
ballardw
Super User

Please show the code you are using to read the data back in. I suspect the issue is going to be with either a missing or incorrect infile option or possible an extra option that is not needed.

 

You may need to provide a tad more detail than "goofy" and some example data from your Set Data; statement may help as well.

 

Also which operating system are you running?

With windows your file statment generates this error:

ERROR: A component of D:\Data\WORK\SAS Temporary Files\_TD9908\file:\output is not a directory.

likely from the FILE: bit.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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