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

Can someone help me read the DATE variable as a DATE7. format? I failed so I am just reading it as character format. The code is below. I am using SAS University Edition. Thanks.

 

data sasuser.amounts;
   input Name $1-12 EmpID 14-18 Date $20-26 Amt 28-29;
datalines;
ANKERTON, L. 11123 08OCT16 92
ANKERTON, L. 11123 15OCT16 43
DAVIS, R.    22298 04OCT16 16
MASTERS, T.  33351 13OCT16 18
MASTERS, T.  33351         27
THOMAS, A.         21OCT16 15
WOLMER, B.   44483
;
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Assuming that the date always appears in columns 20-26:

 

input .....   @20 date date7.  ...........;

 

You would probably want to add a FORMAT statement to print DATE in the format of your choice when displaying the data.

View solution in original post

2 REPLIES 2
Astounding
PROC Star

Assuming that the date always appears in columns 20-26:

 

input .....   @20 date date7.  ...........;

 

You would probably want to add a FORMAT statement to print DATE in the format of your choice when displaying the data.

danielhanbitlee
Calcite | Level 5

Awesome! 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
  • 678 views
  • 0 likes
  • 2 in conversation