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!


 

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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