BookmarkSubscribeRSS Feed
pavan1
Obsidian | Level 7

Hello ,

 

i've a situation  like, i need to use PL/SQL functionality in PROC SQL , but i don't want to connect to any database ,i've all my datasets in work library only.

 

Just wanted to use PL/SQL,SQL functions.

 

Is it possible to do it in SAS. Suggestions are appreciated.

 

Thanks

3 REPLIES 3
Reeza
Super User

No. SQL Passthrough literally takes your PL/SQL code and passes it to the Oracle server, so it requires the Oracle server. 

 

I'm assuming you're trying to avoid recoding something in PL/SQL or it's something you're more familiar with and would prefer to use rather than SAS data steps? Otherwise, data steps offer a ton of functionality to accomplish what you need.  

 


@pavan1 wrote:

Hello ,

 

i've a situation  like, i need to use PL/SQL functionality in PROC SQL , but i don't want to connect to any database ,i've all my datasets in work library only.

 

Just wanted to use PL/SQL,SQL functions.

 

Is it possible to do it in SAS. Suggestions are appreciated.

 

Thanks


 

pavan1
Obsidian | Level 7
Hi Reeza,

Thanks for the Reply, yes i would like to replicate row_number() over (partition by var1,var2 order by var1, var2, var3) ,for which i'm yielding wrong results when i try to replicate in Data Step with order by and first.var concepts.

Thanks
Reeza
Super User
A data step can definitely do that, but you likely need a sort ahead of time. You can also look at the monotonic() function but SAS SQL doesn't support PARTITION.

Enumeration is usually straightforward:
https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/

If you need further help, post some example data, fake data is 100% fine, and what code you tried that isn't work. First and BY should definitely be able to replicate the order. If you have ties that will affect the results though, so it may not be exactly identical as SQL doesn't enforce any sort order on data sets.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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