I am new to DS2 and want to test a few things. In the below example, hoe can I create a package for proc sql step (table3) and use it further in the program?
data table1;
input id name $;
cards;
1 name1
2 name2
3 name3
4 name4
;
run;
data table2;
input id city $;
cards;
1 city1
2 city2
3 city3
5 city5
;
run;
proc sql;
create table table3 as
select a.id, a.name, b.city
from table1 a
left join table2 as b
on a.id = b.id
order by 1;
quit;
1. Have see seen this page (SAS® 9.4 DS2 Language Reference, Sixth Edition - Example: SQL in a DS2 Program)?
2. Any reason you want to do this? DS2 is only useful if you have distributed data.
Yes, I have been to that page.
But what I need is to create a package of that sql step and then send that package to someone to use. I need the package so that I can hide the code.
Thanks.
> so that I can hide the code
You could use a secure macro.
Be sure to read this discussion: Compile already existing Macros SECURE
I apologise for late response. I was aware of the SECURE option but the problem is that stored compiled macro can't be moved to another operating system or to a different release of SAS.
> stored compiled macro can't be moved to another operating system or to a different release of SAS.
Whereas a DS2 package is immune to these issues?
What did you try? In what way did it fail?
Also why would you WANT to hide the code? Is there some reason?
Good day
I would like to know if you are creating in memory variables?
will you be using Packages, methods and data grids?
just a highlight n your purpose of your exercise.
I have been working on sas ds2 to store temporal variables where system will pass one input at time, or for batch processing.
@langalife Unfortunately some old discussions don't get closed. Always worth to check the last posted date.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.