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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 691 views
  • 0 likes
  • 2 in conversation