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

 

data Icecream_Sales;
Infile "/folders/myshortcuts/Myfolders/Imports/Sales.dat";
Firstobs= 2 obs= 2;
Input Flavours :$9. Prd_cd Price;
run;
proc print data=icecream_sales;
run;


data Stud_scores;
infile "/folders/myshortcuts/Myfolders/Imports/Scores.dat";
Missover;
input Names $ L M P C B;
run;
proc print data=stud_scores;
run;

data Stud_address;
infile "/folders/myshortcuts/Myfolders/Imports/Address.dat";
Truncover;
input Names $15. Suite Street $16.;
run;
proc print data=stud_address;
run;

data Icecream_Sales;
Infile "/folders/myshortcuts/Myfolders/Imports/Sales.dat";
Firstobs= 2 obs= 2;
Input Flavours :$9. Prd_cd Price;
run;
proc print data=icecream_sales;
run;


data Stud_scores;
infile "/folders/myshortcuts/Myfolders/Imports/Scores.dat";
Missover;
input Names $ L M P C B;
run;
proc print data=stud_scores;
run;

data Stud_address;
infile "/folders/myshortcuts/Myfolders/Imports/Address.dat";
Truncover;
input Names $15. Suite Street $15.;
run;
proc print data=stud_address;
run;

Hi, when i tried running this above 3 programs in university edition, unable to generate desired results.

 

NOTE: when i entered missover, truncover and firstobs function no change of colour occured.

 

I have attached the raw data sets.

 

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
AMSAS
SAS Super FREQ

Can you explain what you are trying to achieve?
From the code, I can see you have some syntax errors. You have semicolons at the end of the infile statement lines followed by infile options which should be part of the infile statement. e.g.

data Icecream_Sales;
Infile "/folders/myshortcuts/Myfolders/Imports/Sales.dat" /* You have a semicolon here that needs deleting*/ Firstobs= 2 obs= 2;
Input Flavours :$9. Prd_cd Price;
run;
proc print data=icecream_sales;
run;

View solution in original post

3 REPLIES 3
AMSAS
SAS Super FREQ

Can you explain what you are trying to achieve?
From the code, I can see you have some syntax errors. You have semicolons at the end of the infile statement lines followed by infile options which should be part of the infile statement. e.g.

data Icecream_Sales;
Infile "/folders/myshortcuts/Myfolders/Imports/Sales.dat" /* You have a semicolon here that needs deleting*/ Firstobs= 2 obs= 2;
Input Flavours :$9. Prd_cd Price;
run;
proc print data=icecream_sales;
run;
Deepak13
Obsidian | Level 7

Hi,

 

Many thanks for your support!

 

Issue got resolved, It is due to the semicolon I didnt get results properly.

ballardw
Super User

Always examine the log after running code.

 

Go to the log after running the code, copy the log with the (I expect) error messages, and paste here into a code box opened using the forum's {I} or "running man" icons.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 858 views
  • 0 likes
  • 3 in conversation