BookmarkSubscribeRSS Feed
pablas29
Fluorite | Level 6

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;

 

9 REPLIES 9
ChrisNZ
Tourmaline | Level 20

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.

pablas29
Fluorite | Level 6

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.

ChrisNZ
Tourmaline | Level 20

> so that I can hide the code

You could use a secure macro.

Be sure to read this discussion: Compile already existing Macros SECURE

pablas29
Fluorite | Level 6

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.

ChrisNZ
Tourmaline | Level 20

> 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?

 

pablas29
Fluorite | Level 6
Any solution?
Tom
Super User Tom
Super User

What did you try? In what way did it fail?

Also why would you WANT to hide the code?  Is there some reason?  

langalife
Calcite | Level 5

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.

 

Patrick
Opal | Level 21

@langalife Unfortunately some old discussions don't get closed. Always worth to check the last posted date.

Patrick_0-1666609849631.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 9 replies
  • 997 views
  • 1 like
  • 5 in conversation