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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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