BookmarkSubscribeRSS Feed
sasphd
Lapis Lazuli | Level 10

I want to eliminate the variable having less than 36 observations This is my program but it does not work

proc sql;
create table fundno_limit as
select *
from joint_data
where mret is not null
group by rank_no
Having count(mret)>=36
order by rankdate and rank_no;
quit;

8 REPLIES 8
Astounding
Opal | Level 21

There may be more changes needed, but you could start with:

 

order by rankdate, rank_no;

ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

 

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

sasphd
Lapis Lazuli | Level 10

no there is not an error in the log.

However I did not succed to join database I can not find  myfolders folder and Edit the AutoExec file to add the program to your autoexec

it is really a trouble for me 

. can explain for me haw to add data to this forum................

Reeza
Super User

@sasphd I'll be happy to walk you through the instructions. They're currently numbered steps, which step are you having issue with?

sasphd
Lapis Lazuli | Level 10

 

Step 2 I can not find myfolders folders to place the file

 

1. Download the zip file from Mark's blog: http://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/

2. Extract the zip file and place the data2datastep.sas program into your myfolders folder set up.

Screen Shot 2016-03-23 at 8.03.29 PM.png

3. In SAS University Edition, go to the Edit the AutoExec file to add the program to your autoexec

Screen Shot 2016-03-23 at 8.04.29 PM.png

 

4. In the Autoexec, add the reference to the program, and RUN, then SAVE.

 

%include '/folders/myfolders/data2datastep.sas' /lrecl=1000;

Screen Shot 2016-03-23 at 8.04.44 PM.png

 

 

5. Test the code in SAS UE

 

%data2datastep(cars,sashelp,,5)

6. A file is generated called create_sashelp_CARS_data.sas

Reeza
Super User

When you set up SAS UE you set up a folder called myfolders? This assumes you're using SAS UE, if not these instructions don't apply.

 

If you don't remember where you set up myfolders, open VirtualBox, go to the shared folders setting and find the path.  That's where you can place the file.  

 

AS A LAST RESORT

If you absolutely cannot figure out the location, paste the full macro code into your autoexec program itself and DON'T include the %INCLUDE statement. 

OR paste the macro program into a SAS UE window, run the code and then skip to step 5. 

 

Actually you'll still need to find where myfolders is set up so that you find the file with the data step code. 

 

sasphd
Lapis Lazuli | Level 10

 

What do you mean by paste the full macro code into your autoexec program itself and DON'T include the %INCLUDE statement. 

is this the macro

%include'/folders/myfolders/data2datastep.sas' /lrecl=1000;

 My problem is that I have SAS 9.4 from my university so I did not succedd to find all folders you demand

Reeza
Super User

Save the SAS program to a known location then and in your %INCLUDE change the path to wherever you saved the file. 

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
  • 8 replies
  • 1750 views
  • 1 like
  • 4 in conversation