BookmarkSubscribeRSS Feed
novinosrin
Tourmaline | Level 20

Reverse style, the previous was PDV to Hash, this time Hash to PDV. When Hashman takes personal interest offline in getting me to speed, I love experimenting Guru's teachings 

 



data have;
 input word $;
 datalines;
 A
 B
 C
 D
;
data want;
dcl hash H (dataset:'have',ordered: "A") ;
h.definekey  ('word') ;
h.definedone () ;
dcl hiter hh('h');
do _n_=1 to 1000;
 do while(hh.next()=0);
 output;
 end;
end;
stop;
set have;
run;

 

 

 

Reeza
Super User

The function is SURVEYSELECT. Set the REP to be the number of replicates and the sampling rate to be 100% (1). 

 

proc surveyselect data=have out=want method=srs rep=1000 samprate=1;
run;

proc freq data=want;
table word;
run;

@changxuosu wrote:

Dear SAS community,

 

I have a data set like this

 

A

B

C

D

 

 

I want to repeat it 1000 times like

 

A

B

C

D

A

B

C

D

A

B

C

D

.

.

.

.

.

 

Is there any SAS function that achives this?

Thank you all! Happy holliday!


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 4037 views
  • 6 likes
  • 5 in conversation