BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Salah
Quartz | Level 8

Hello

 

I am trying to simulate data, since I need to call that data more than once in my code, I defined it as a function. The issue here is that I need to return that data (X) along with another numeric value that I called it (q). 

How can I do that?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

You can do either of the following:

1. Define your function to be a subroutine. If you use a subroutine, you can return multiple arguments.

2. Define your function to return a list. You can then access individual items in the list.

 

Using a subroutine is more efficient and doesn't have any learning curve. However, many programmers enjoy using lists to pack a bunch of related items into a single symbol.

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

You can do either of the following:

1. Define your function to be a subroutine. If you use a subroutine, you can return multiple arguments.

2. Define your function to return a list. You can then access individual items in the list.

 

Using a subroutine is more efficient and doesn't have any learning curve. However, many programmers enjoy using lists to pack a bunch of related items into a single symbol.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 961 views
  • 0 likes
  • 2 in conversation