BookmarkSubscribeRSS Feed
deleted_user
Not applicable
1. I have date format YYYYMMDD
d1 = 20080416
How can I convert it to sas date format such as 16April2008 ?

2 .PROC IMPORT OUT= WORK.mydata
DATAFILE= "D:\SAS_data\RawData\test.xls"
DBMS=EXCEL2000 REPLACE;
SHEET="test$";
GETNAMES=YES;
RUN;
proc import above, Can I define format of variables in this part ?
thanks in advance.
1 REPLY 1
deleted_user
Not applicable
rather than use PROC IMPORT, try using the SAS/Access to PC FIles facilities in the excel LIBNAME engine. That supports a dataset option SASDATEFMT=.

The Help and online Doc declares

~~~~~~~~~~~~~SAS Documentation extract ~~~~~~~~~~~~~~~~~~~~~~
SASDATEFMT=(data-source-date-column-1='SAS-date-format'<... data-source-date-column-n='SAS-date-format'>)


Syntax Description

data-source-date-column
specifies the name of a date column in a data source table.

SAS-date-format
specifies a SAS date format that has an equivalent (like-named) informat. For example, DATETIME21.2 is both a SAS format and a SAS informat, so it is a valid value for the SAS-date-format argument.
~~~~~~~~end of SAS Documentation extract ~~~~~~~~~~~~~~~~~~~~~~

Navigate the "Help and Documentation" menu item (a link into "compiled html help" ) through
SAS Products
SAS/Access
PC Files
Accessing PC Files
The LIBNAME Statement
SASDATEFMT=
On line at
http://support.sas.com/onlinedoc/913/getDoc/en/acpcref.hlp/a002261342.htm

Please can someone show the correct syntax for a link that opens such a page, but also having the tree pane on the left ?

PeterC

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!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 1 reply
  • 821 views
  • 0 likes
  • 1 in conversation