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

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 377 views
  • 1 like
  • 2 in conversation