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

Help needed. 

I’m running SAS 9.4 TS Level 1M3 X64_SRV12 platform.

A vendor requested that I provide a datafile that contains a unix time stamp in the filename.  I’ve created macro variables previously with dates such as  %let dt="25FEB2017"d; and have used variables in the file name before such as:

 

proc export data=histfile1

outfile="E:/SASuser/DBS_Stage/Reporting/Weekly Composite Report/data_h_%sysfunc(today(),yymmdd7).csv"

dbms=csv replace;

 

Is there a format specific to Unix dates that I need to use?

 

1 ACCEPTED SOLUTION

Accepted Solutions
AaroninMN
Obsidian | Level 7

 

Try this:

Instead of the today() in the outfile statement, go to  www.epochconverter.com

(I've found this site quite helpful for my date needs).

Scroll down until you see the format for unix time.  You can use this for the proper format for your unix timestamp for the file name.   

 

Hope this helps!

 

View solution in original post

2 REPLIES 2
AaroninMN
Obsidian | Level 7

 

Try this:

Instead of the today() in the outfile statement, go to  www.epochconverter.com

(I've found this site quite helpful for my date needs).

Scroll down until you see the format for unix time.  You can use this for the proper format for your unix timestamp for the file name.   

 

Hope this helps!

 

Jpep
Fluorite | Level 6

This is a great resource! I will share this with my team as well.

Thank you!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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