BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
IdlanHnf
Obsidian | Level 7

when i run this coding, the price always change everytime I run it. is it possible to make it become fix? I want it to be fix no matter how much run I did on it.

PROC SQL;
UPDATE WORK.data2
SET 'Price (RM)'n=RAND("INTEGER",12,15);
RUN;
PROC PRINT DATA=WORK.data2;
RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

Please try the seed, we need to use seed to make the rand generate consistent values

 

data data3;
set data2;
call streaminit(123);
'Price (RM)'n=RAND("INTEGER",12,15);
RUN;
PROC PRINT DATA=WORK.data3;
RUN;
Thanks,
Jag

View solution in original post

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

Please try the seed, we need to use seed to make the rand generate consistent values

 

data data3;
set data2;
call streaminit(123);
'Price (RM)'n=RAND("INTEGER",12,15);
RUN;
PROC PRINT DATA=WORK.data3;
RUN;
Thanks,
Jag
IdlanHnf
Obsidian | Level 7
Thank you so much. It's working