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

Hello,

 

Why there is nothing for table stack_monthly? Anything wrong with the macro? I attached part of the data for chargedisb. Please help, thanks!

 

%macro pull(stack, where);
PROC SQL;
CREATE TABLE &stack. AS
SELECT
*
FROM
chargedisb
&WHERE.

%mend;


%pull(stack_monthly, where month3 ='January' );
%pull(stack_ytd, where month3 is not null );

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

The instructions here will allow you to create data step code that you can paste to the forume or attach as a TEXT file to create a data set we can test code against: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

A very likely cause is that you are missing a ; to end the create table statement and  missing quit; to end the Proc Sql

View solution in original post

2 REPLIES 2
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

The instructions here will allow you to create data step code that you can paste to the forume or attach as a TEXT file to create a data set we can test code against: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

A very likely cause is that you are missing a ; to end the create table statement and  missing quit; to end the Proc Sql

Astounding
PROC Star

Assuming you fix the errors already pointed out ...

 

It looks like your month values are centered.  The actual value would never be "January" because there would be leading blanks.  In SAS, "January" and "   January" are different.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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