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 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!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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