BookmarkSubscribeRSS Feed
TaeYi
Calcite | Level 5

TaeYi_0-1600052416117.png

 

 

 

 

 

TaeYi_0-1600053730483.png

 

 

 

 

TaeYi_1-1600053765303.png

 





PROC IMPORT OUT= employees DATAFILE=
""
DBMS=xlsx REPLACE;
GETNAMES=YES;
RUN;
PROC PRINT DATA= employees;
RUN;


PROC TABULATE DATA= employees;
CLASS position;
TABLE position ALL;
RUN;

DATA employees;
SET employees;
IF endDate =. THEN endDate = TODAY();
RUN;

DATA truckers;
SET employees;
IF JOB ne 'Truck Driver' THEN DELETE;
RUN;

DATA truckers;
SET employees;
yearsOfService=INT(YRDIF(hireDate,endDate));
RUN;

PROC PRINT DATA=truckers;
RUN;

ODS EXCEL
FILE=""

OPTIONS(sheet_interval='table');
PROC FREQ DATA=truckers;
TABLE yearsOfService;
RUN;

ODS EXCEL CLOSE;

 

1 REPLY 1
brzcol
SAS Employee

Hi, would you mind re-posting the three images above your code? We are unable to see them. Also, did your proc import step successfully run to create the table?

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 296 views
  • 0 likes
  • 2 in conversation