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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 542 views
  • 0 likes
  • 2 in conversation