BookmarkSubscribeRSS Feed
MichalK
SAS Employee

Mała zagadka.

Mamy kod poniżej:

data x;
	a = 1;
	b = 2;
	c = 3;
run;
data y;
	retain d;
	set x;
run;

Ile zmiennych będzie miał zbiór y?

1 REPLY 1
yabwon
Onyx | Level 15

Hej, 

 

3

 

W Twoim przykładzie `retain` mówi tylko "utrzymuj zmienną", więc nie tworzy tej zmiennej, Żeby `d` się "zmaterializowała" potrzebny jest jakiś kawałek kodu który ją utworzy. I może to być np. `d=17;` ale może być to `retain d 0`, który zostanie zinterpretowany "utrzymuj zmienną, dla której inicjacja ustala wartość 0".

 

Fajna lektura:

https://support.sas.com/resources/papers/proceedings/proceedings/sugi22/ADVTUTOR/PAPER34.PDF

 

All the best

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



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!

Discussion stats
  • 1 reply
  • 781 views
  • 1 like
  • 2 in conversation