BookmarkSubscribeRSS Feed
krishna13
Calcite | Level 5

I working academic project, I converted SAS date format to MMDDYYYY. 

output displayed as expected.

 

How can to download output as CSV file?

else to save output as  CSV file in same path ?

4 REPLIES 4
tomrvincent
Rhodochrosite | Level 12
What have you tried so far?
Amir
PROC Star

Are you looking for something like the following. If not then please provide some input data and what you want it to look like when it is output.

 

/* create data */
data have;
   input
      id      : $char8.
      my_date : date9.
   ;

   format
      my_date mmddyyn8.
   ;

   datalines;
1 16jan2020
2 17jan2020
3 18jan2020
;


/* write data out as a csv */
data _null_;
   file tempfile dlm=',';

   set have;

   put
      id
      my_date
   ;
run;

 

Regards,

Amir.

Reeza
Super User
PROC EXPORT, right click the file and select export or use the Export Task for starters.

It varies a bit based on the version of SAS and if you're on a server/UE.
Tom
Super User Tom
Super User

@krishna13 wrote:

I working academic project, I converted SAS date format to MMDDYYYY. 

output displayed as expected.

 

How can to download output as CSV file?

else to save output as  CSV file in same path ?


Are you working on some remote SAS server?  Is it one of SAS's servers (on demand for academics?) or a server at your institution.  When you say "download" do you mean you need don't know how to create a CSV file?  Or do already know how to create a CSV file but are having trouble moving it somewhere.  Where do you want to move it?  

How are you running your SAS code?  Are you using some front end, like SAS/Studio or Enterprise Guide?  Are you using SAS Display Manage to run SAS interactively?  Or do you have some other way you are running SAS?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 783 views
  • 0 likes
  • 5 in conversation