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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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