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



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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