BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Curious4
Fluorite | Level 6

Anyone has advice on how I can go about doing problem 2 of this sneario? I have already done part 1

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
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;

 

Curious4_0-1605715681018.pngCurious4_1-1605715787477.png

 

sweepstakes.dat:

Jessica Cho
Gold 2006 46,153
American Express
VA

Bashid Al Herrum
Platinum 2011 21,848
Visa
CT

Johnathan Dudashman
Silver 2010 109,677
Visa
NY

Paul Duncan
Gold 2004 5,988
Mastercard
DC

Sarah Smith
Gold 2010 17,325
Visa
FL

Amanda Cole
Platinum 2008 68,077
Visa
MD

Gregory De Silva
Platinum 2007 92,785
American Express
DE


 

View solution in original post

14 REPLIES 14
PaigeMiller
Diamond | Level 26

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)

--
Paige Miller
Curious4
Fluorite | Level 6
I can send a more zoomed in picture but the zip is the only way to show it as the purpose of the assignment is to work with zipped files without extracting.
Curious4
Fluorite | Level 6

I have updated the post with better images.

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Curious4
Fluorite | Level 6

Okay. Thanks anyway!

Reeza
Super User
Zip files have nothing to do the second question so you could provide the original data as a data step or as the text file.
Curious4
Fluorite | Level 6

I printed it to the original post. thats all i know how to do

Reeza
Super User
Have you not imported the file into a SAS data set?
Curious4
Fluorite | Level 6
The assignment does not ask me to do that. it just says to read it from the zip.
Reeza
Super User

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.

 

 

Curious4
Fluorite | Level 6
Okay, I am not sure. the instructor said to not use set ia.prob1 so i took it as not
Reeza
Super User
FYI - If Problem 1 was not solved correctly you cannot answer problem 2. Your code as shown would not be a correct answer to problem 1.
Curious4
Fluorite | Level 6

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;

Reeza
Super User
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;

 

Curious4_0-1605715681018.pngCurious4_1-1605715787477.png

 

sweepstakes.dat:

Jessica Cho
Gold 2006 46,153
American Express
VA

Bashid Al Herrum
Platinum 2011 21,848
Visa
CT

Johnathan Dudashman
Silver 2010 109,677
Visa
NY

Paul Duncan
Gold 2004 5,988
Mastercard
DC

Sarah Smith
Gold 2010 17,325
Visa
FL

Amanda Cole
Platinum 2008 68,077
Visa
MD

Gregory De Silva
Platinum 2007 92,785
American Express
DE


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 14 replies
  • 3175 views
  • 0 likes
  • 3 in conversation