HW1_code
HW1_code
sas
/* Part1 */
LIBNAME MYREF '/home/u63991217/sasuser.v94';
PROC IMPORT
DATAFILE= "/home/u63991217/my_shared_file_links/haticesahinoglu0/DATA Files/Artists.csv"
OUT = MYREF.user_artist
DBMS="dlm";
DELIMITER =",";
run;
/* Part2 */
DATA PRESIDENTS;
Infile '/home/u63991217/my_shared_file_links/haticesahinoglu0/DATA Files/USpresident.txt' dlm=' ' DSD;
/*
1. INPUT option
a. I have the president's name followed by a dollar sign because the name is a character.
I also specify in LENGTH that name should read 10 characters. This is because Washington is longer than the
default 8 character limit.
b. Party is follwed by a dollar sign because it is a character. 8 bytes will be fine be because it is either
R (republican) or D (democrat)
c. number, there is a number that I don't know what it signifies as the third column in the text file.
Since it is a number, not need for a trailing $
/* Part3 */
DATA PUMPKINS;
DATA PUMPKINS_MODIFIED;
INFILE '/home/u63991217/my_shared_file_links/haticesahinoglu0/DATA Files/Pumpkin.dat';
input name $16. +1 num1 2. +1 type $1. +1 date mmddyy10. +1 meas1
3.1 +1 meas2 3.1 meas3 3.1;
about:blank 1/2
2/8/25, 7:02 PM Code: aggregate.sas
about:blank 2/2