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
Opal | Level 21

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 824 views
  • 0 likes
  • 3 in conversation