BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Pato485
Calcite | Level 5

How can i save table and it should have date of save in the name of table

 

so how can i save table ...

 

proc sql,

 

create table work.zaloha_% as....;

quit; (and % should be for today 20012023, tomorrow it should be 21012023.... and so on, so i want to have backup of table saved every day. how can i do it?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You would be wise to use dates that sort properly, but the way you have chosen the dates, they will not sort properly, the table for 20012023 will sort above 20022023 but it will not be next to 21012023. So, use YYMMDD dates.

 

create table work.zaloha_%sysfunc(putn(%sysfunc(today()),yymmddn8.)) ...

 

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

You would be wise to use dates that sort properly, but the way you have chosen the dates, they will not sort properly, the table for 20012023 will sort above 20022023 but it will not be next to 21012023. So, use YYMMDD dates.

 

create table work.zaloha_%sysfunc(putn(%sysfunc(today()),yymmddn8.)) ...

 

--
Paige Miller

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

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