Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Members were tracked automatically via the computer check - in system when they arrived and left the gym. The raw data file NewYears.dat contains variables
Members were tracked automatically via the computer checkin system when they arrived and left the gym. The raw data file NewYears.dat contains variables for the member ID and checkin times for the first days of the year, followed by the checkout times for the first days of the year.
a Examine the raw data file NewYears.dat and read it into SAS. Preserve the special characters found in the first row of the data file in the variable names
Here is an example of the raw data: IDIn Day In Day In Day In Day In Day In Day In Day Out Day Out Day Out Day Out Day Out Day Out Day ::::::::::::::::
This is what I tried and it still didn't work
infile 'NewYears.dat' dlm dsd missover firstobs;
format ID ;
array InTimes InDayInDay;
array OutTimes OutDayOutDay;
input ID $;
do i to ;
if i then input InTimesi : time;
if i then input OutTimesi : time;
end;
drop i;
run;
The example code that was given also throws errors
ta gymdata;
infile 'NewYears.dat' dlm dsd missover firstobs;
length ID $ InTimeOutTime time;
format ID $ InTimeOutTime time;
array InTimes InTime InTime;
array OutTimes OutTime OutTime; Note: changed OutTime to OutTime
input ID $ InTime InTime OutTime OutTime;
drop i;
run;
This keeps happening Im not sure what I am missing.
ERROR : Syntax error, expecting one of the following: a name, ; DEFAULT, ALL
CHARACTERCHARNUMERIC
ERROR : The option is not recognized and will be ignored.
ERROR : The symbol is not recognized and will be ignored.
length ID $ InTimeOutTime time;
ERROR: Alphabetic prefixes for enumerated variables InTimeOutTime are different.
Format ID $ InTimeOutTime time;
ERROR : Syntax error, expecting one of the following: a name, a numeric constant, $
VARCHAR, ALLCHARACTERCHARNUMERIC
ERROR : The length of numeric variables is
ERROR : Expecting a format name.
ERROR : The symbol is not recognized and will be ignored.
ERROR : Syntax error, statement will be ignored.
array InTimes InTimeInTime;
array OutTimes OutTimeOutTime;
Input ID $ InTimeInTime OutTimeOutTime;
drop i;
run;
WARNING: The variable i in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: The SAS System stopped processing this step because of errors.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started