BookmarkSubscribeRSS Feed
a13
Calcite | Level 5 a13
Calcite | Level 5

Code


data total_sales;
input Date mmddyy10. +2 Amount comma5.;
datalines;
09/05/2000 1,382
10/19/2000 1,235
11/30/2000 2,391
;
run;

 

Output

 

 

114858382 
214902235 
314944391

 

 

3 REPLIES 3
muratatik
Obsidian | Level 7
DATA TOTAL_SALES;
FORMAT DATE MMDDYY10.;
INPUT DATE :MMDDYY10. AMOUNT :COMMA5.3;
DATALINES;
09/05/2000 1,382
10/19/2000 1,235
11/30/2000 2,391
;
RUN;
RW9
Diamond | Level 26 RW9
Diamond | Level 26

SAS stores dates as number of days since a certain timepoint.  The number you are seeing is the raw value, i.e. the number of days since the cuttoff.  You need to format this number of days into the display type you want.

Astounding
PROC Star

The smallest change possible:  change +2 to +1.  +2 moves you past the first digit, to the comma.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 803 views
  • 0 likes
  • 4 in conversation