BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jc3992
Pyrite | Level 9
DATA fsalesP; 
   INFILE "&dirdata.Flowers_Plus.dat"; 
   INPUT CustID $ @9 SaleDate MMDDYY10. Petunia SnapDragon Marigold; 
   Month = MONTH(SaleDate); 
run; 
 
PROC SORT DATA = fsalesP; 
   BY Month;  
RUN; 
 
TITLE; 
PROC PRINT;RUN;
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         data fsalesP;
 74         infile '/folders/myfolders/Flowers_Plus.dat';
 75         input CustID $ @9 Date MMDDYY10. Petunia SnapDragon Marigold;
 76         Month = MONTH(SaleDate);
 77         run;
 
 NOTE: Variable SaleDate is uninitialized.
 NOTE: The infile '/folders/myfolders/Flowers_Plus.dat' is:
       Filename=/folders/myfolders/Flowers_Plus.dat,
       Owner Name=sasdemo,Group Name=sas,
       Access Permission=-rw-rw-r--,
       Last Modified=09Feb2018:21:01:38,
       File Size (bytes)=446
 
 NOTE: 14 records were read from the infile '/folders/myfolders/Flowers_Plus.dat'.
       The minimum record length was 30.
       The maximum record length was 30.
 NOTE: Missing values were generated as a result of performing an operation on missing values.
       Each place is given by: (Number of times) at (Line):(Column).
       14 at 76:9   
 NOTE: The data set WORK.FSALESP has 14 observations and 7 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 78         
 79         proc sort data=fsalesp;
 80         by Month;
 81         run;
 
 NOTE: There were 14 observations read from the data set WORK.FSALESP.
 NOTE: The data set WORK.FSALESP has 14 observations and 7 variables.
 NOTE: PROCEDURE SORT used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 
 82         
 83         title;
 84         proc print;
 85         run;
 
 NOTE: There were 14 observations read from the data set WORK.FSALESP.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.11 seconds
       cpu time            0.12 seconds
       
 
 86         
 87         
 88         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 101        

Hello evertone,

I ran this code provided by our instructor,

and I did not really understand why there were two missing values for the last two columns,

and what did they mean?

Is there anyone who can help me with this?

Thank you much!

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

The instructor had a small oversight.  The INPUT statement creates DATE (not SaleDate).  So the calculation for MONTH should be:

 

month = month(date);

View solution in original post

2 REPLIES 2
Astounding
PROC Star

The instructor had a small oversight.  The INPUT statement creates DATE (not SaleDate).  So the calculation for MONTH should be:

 

month = month(date);

jc3992
Pyrite | Level 9

Thank you very much!

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 679 views
  • 1 like
  • 2 in conversation