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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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