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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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