Help using Base SAS procedures

SQL PROCEDURES

Reply
New Contributor
Posts: 2

SQL PROCEDURES

 

Hi.

i have to write SQL procedure using dataset 'Inizial_data' to calcolate total vehicle cost (TOT_VEH-COST) BY ASSETTYPE for vehicles not older than 10.What will be my output?

 

Can we help me?

 

thank you

 

 

Super User
Posts: 6,938

Re: SQL PROCEDURES

[ Edited ]

In proc sql, use a where condition for the "vehicles not older than 10" part. Use a group by clause for the "by assettype" part. Use the sum() function for summarizing.

 

Study the documentation for PROC SQL.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Super User
Posts: 7,401

Re: SQL PROCEDURES

Is this a college question or something?  It sounds like you should be working this out.  Have a go and come back with specific questions.  There are numerous examples in the documentation or on w3schools:
https://www.w3schools.com/sql/

Which can get you going, its a very simple problem.

Regular Contributor
Posts: 184

Re: SQL PROCEDURES

Looking at the question you posted on a different sub-forum https://communities.sas.com/t5/SAS-Studio/DEBUGGING-OPTIONS-IN-SAS/m-p/387260 it appears that these questions are for a university exam. I don't wish to sound patronising but these are fairly simple SAS questions and if we just give you the answers it might help you pass an exam but you won't actually learn very much in the process.

 

My advice would be:

 

1. Read the extensive documentation on the SAS Web Site; and

2. Try to answer the question yourself (with code where applicable); and

3. Use google to see if the question has been asked before; and

4. If you're still stuck post the question on here showing us what you've tried.

 

Everyone on here is super-helpful but we want to help you in a way that will actually teach you something and not undermine the purpose of your course.

Ask a Question
Discussion stats
  • 3 replies
  • 128 views
  • 4 likes
  • 4 in conversation