Anyone has advice on how I can go about doing problem 2 of this sneario? I have already done part 1
data ia.prob02;
set ia.prob01;
prize = (2012-since) * 10000 /*years*/ + floor(miles/100)*100 /*miles*/;
keep first_name last_name miles state_code prize;
run;
@Curious4 wrote:
Anyone has advice on how I can go about doing problem 2 of this sneario? I have already done part 1
libname ia "/folders/myfolders/DATASETS"; data prob1; set ia.prob1; Filename zipfiles zip '/folders/myfolders/DATASETS/sweepstakes.zip'; Infile zipfiles(sweepstakes.dat); Filename sweepstakes zip '/folders/myfolders/DATASETS/sweepstakes.zip' member ='sweepstakes.dat'; infile sweepstakes; proc print data=prob1;
sweepstakes.dat:
Jessica Cho
Gold 2006 46,153
American Express
VABashid Al Herrum
Platinum 2011 21,848
Visa
CTJohnathan Dudashman
Silver 2010 109,677
Visa
NYPaul Duncan
Gold 2004 5,988
Mastercard
DCSarah Smith
Gold 2010 17,325
Visa
FLAmanda Cole
Platinum 2008 68,077
Visa
MDGregory De Silva
Platinum 2007 92,785
American Express
DE
Hello, @Curious4 . I'm sorry to be so picky, but the text in your screen captures is barely readable. Can you provide the text in the screen captures in somewhat larger size? (I do not download attachments, they are a security threat, so I cannot look in your zip file)
I have updated the post with better images.
Well, thank you, I can now read problem 2, but since I refuse to download .zip files (or any files, really), you'll have to wait for someone else to help.
Okay. Thanks anyway!
I printed it to the original post. thats all i know how to do
I read it as asking you to create the permanent sas data set as shown but I guess I don't understand your problem then. Good Luck.
@Curious4 wrote:
The assignment does not ask me to do that. it just says to read it from the zip.
Yes, I am still working on problem 1 but I don't know why I am still getting errors. This is my revised code, I think I am on a better track but haven't gotten rid of all errors.
Filename zipfiles zip '/folders/myfolders/DATASETS/sweepstakes.zip';
/*Filename sweepstakes zip '/folders/myfolders/DATASETS/sweepstakes.zip' member ='sweepstakes.dat';*/
data prob1a;
Infile zipfiles(sweepstakes.dat);
/*infile sweepstakes;*/
proc print data=prob1a;
data ia.prob02;
set ia.prob01;
prize = (2012-since) * 10000 /*years*/ + floor(miles/100)*100 /*miles*/;
keep first_name last_name miles state_code prize;
run;
@Curious4 wrote:
Anyone has advice on how I can go about doing problem 2 of this sneario? I have already done part 1
libname ia "/folders/myfolders/DATASETS"; data prob1; set ia.prob1; Filename zipfiles zip '/folders/myfolders/DATASETS/sweepstakes.zip'; Infile zipfiles(sweepstakes.dat); Filename sweepstakes zip '/folders/myfolders/DATASETS/sweepstakes.zip' member ='sweepstakes.dat'; infile sweepstakes; proc print data=prob1;
sweepstakes.dat:
Jessica Cho
Gold 2006 46,153
American Express
VABashid Al Herrum
Platinum 2011 21,848
Visa
CTJohnathan Dudashman
Silver 2010 109,677
Visa
NYPaul Duncan
Gold 2004 5,988
Mastercard
DCSarah Smith
Gold 2010 17,325
Visa
FLAmanda Cole
Platinum 2008 68,077
Visa
MDGregory De Silva
Platinum 2007 92,785
American Express
DE
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.