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;
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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.