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

The Sold tables having variable.

 

                                            Alphabetic List of Variables and Attributes

 

                              #    Variable    Type    Len    Format       Label

 

                              4    ShipDay     Num        8    WeekDAY.        Day of the Week of Shipment

                              3    dates         Num        8    MMDDYY10.    Date accessory(s) shipped      

                              1   orders        Num        8                             Number of Order           

                              2    quantity      Num       8                            Quantity                  

                             

 

I want to display table containing 3 variables summarizing by year,  the total number of accessories sold each month;

 

proc sql;
select year(datepart(dates)) as A_Year, month(datepart(dates)) as A_Month , sum(quantity) as TTL_Accessories
from Sold
group by calculated S_Year,
quit;

 

I am getting log error as 

ERROR: The following columns were not found in the contributing tables: quit.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
97
98 NOTE: The SAS System stopped processing this step because of errors.

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

ERROR: The following columns were not found in the contributing tables: quit.

 

If you get such weird error messages then always ask yourself what the heck could trigger SAS to get so confused.

Very often such errors are the result of a forgotten semicolon - and as you do have a comma instead of a semicolon the SAS compiler believes the "quit" is still part of your group by statement and therefore must be a variable.

 

BTW:

If you also create a Month variable then you'll get 12 rows per year but if you only group by year then all 12 rows in the same year will have the same sum. If you want montly sums then you need to add the month to the group by clause.

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

ERROR: The following columns were not found in the contributing tables: quit.

 

If you get such weird error messages then always ask yourself what the heck could trigger SAS to get so confused.

Very often such errors are the result of a forgotten semicolon - and as you do have a comma instead of a semicolon the SAS compiler believes the "quit" is still part of your group by statement and therefore must be a variable.

 

BTW:

If you also create a Month variable then you'll get 12 rows per year but if you only group by year then all 12 rows in the same year will have the same sum. If you want montly sums then you need to add the month to the group by clause.

afs
Calcite | Level 5 afs
Calcite | Level 5
Noted. I made the changes and it worked . Thanks

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 1106 views
  • 0 likes
  • 2 in conversation