BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sas_
Fluorite | Level 6

Hi i am having data but i wnat to export the data into text file but i want to give 3 delimeters ,how can i do it ,i have tested it but it was taking only one delimter.

proc export data=test outfile="/tmp/mydata/test.txt"

   dbms=dlm replace;

   delimiter='^?/';

run;

1 ACCEPTED SOLUTION

Accepted Solutions
ArtC
Rhodochrosite | Level 12

The DATA step can be used to write delimited files.  Consider this step as a starting point.

data _null_;

   set sashelp.class;

   file "c:\temp\test.txt"

         dlmstr='^?/';

   put name age sex height weight;

   run;

View solution in original post

4 REPLIES 4
ArtC
Rhodochrosite | Level 12

The DATA step can be used to write delimited files.  Consider this step as a starting point.

data _null_;

   set sashelp.class;

   file "c:\temp\test.txt"

         dlmstr='^?/';

   put name age sex height weight;

   run;

sas_
Fluorite | Level 6

Thqs

sas_
Fluorite | Level 6

but i am not getting the variable names if i wnat the variable names what should i do i have used put also.

ArtC
Rhodochrosite | Level 12

This will add the variable names.

data _null_;

   set sashelp.class;

   file "c:\temp\test.txt"

         dlmstr='^?/';

   if _n_=1 then put 'name^?/age^?/sex^?/height^?/weight';

   put name age sex height weight;

   run;

There are DATA step solutions that do not require you to know the variable names, but they are more complicated.

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
  • 4 replies
  • 933 views
  • 0 likes
  • 2 in conversation