Answered step by step
Verified Expert Solution
Link Copied!

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 check-in system when they arrived and left the gym. The raw data file NewYears.dat contains variables for the member ID, and check-in times for the first 119 days of the year, followed by the check-out times for the first 119 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: ID,In Day 1,In Day 2,In Day 3,In Day 4,In Day 5,In Day 6,In Day 7, Out Day 2,Out Day 3,Out Day 4,Out Day 5,Out Day 6,Out Day 7,200,8:54:37,7:48:29,6:12:13,5:35:07,8:49:26,8:08:38,5:22:58,6:18:31
This is what I tried and it still didn't work
infile 'NewYears.dat' dlm=',' dsd missover firstobs=2;
format ID 4.;
array InTimes{119} In_Day1-In_Day119;
array OutTimes{119} Out_Day2-Out_Day119;
input ID $4.;
do i =1 to 119;
if i <=119 then input InTimes{i} : time8.;
if i >1 then input OutTimes{i} : time8.;
end;
drop i;
run;
The example code that was given also throws errors
ta gym_data;
infile 'NewYears.dat' dlm=',' dsd missover firstobs=2;
length ID $4. InTime1-OutTime119 time8.;
format ID $4. InTime1-OutTime119 time8.;
array InTimes(119) InTime1- InTime119;
array OutTimes(119) OutTime2- OutTime120; /* Note: changed OutTime119 to OutTime120*/
input ID $ InTime1- InTime119 OutTime2- OutTime120;
drop i;
run;
This keeps happening I'm not sure what I am missing.
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, DEFAULT, _ALL_,
_CHARACTER_,_CHAR_,_NUMERIC_.
ERROR 201-322: The option is not recognized and will be ignored.
ERROR 200-322: The symbol is not recognized and will be ignored.
14! length ID 4$. InTime1-OutTime119 time8.;
------
22
11
-
352
ERROR: Alphabetic prefixes for enumerated variables (InTime1-OutTime119) are different.
15 Format ID 4$. InTime1-OutTime119 time8.;
-
85
200
76
ERROR 22-322: Syntax error, expecting one of the following: a name, a numeric constant, $,
VARCHAR, _ALL_,_CHARACTER_,_CHAR_,_NUMERIC_.
ERROR 352-185: The length of numeric variables is 3-8.
ERROR 85-322: Expecting a format name.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
16 array InTimes(119) InTime1-InTime119;
17 array OutTimes(119) OutTime1-OutTime119;
18 Input ID $ InTime1-InTime119 OutTime2-OutTime120;
19 drop i;
20 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Presentation Aids Practicing Your Speech?

Answered: 1 week ago