what is prime numbers? how we can get plc write sas code?
Answer Posted / bala
***how we can get plc write sas code? ;
data prime;
input numbers @@;
datalines;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
47 48 49 50 51 52 53 54 55 56 57 58
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
76 77 78 79 80
;
run;
data p1(drop= p numbers);
set prime;
P=numbers;
if mod(P,1)= 0 and mod(P,P) = 0 and mod(P,2) ^= 0
and mod(P,3) ^= 0 and mod(P,5)^=0 and mod(P,7)^=0 then
Prime_numbers=P;
if P=3 or P=2 or P=5 or P=7 then Prime_numbers=P;
if not missing(prime_numbers);
put prime_numbers;
run;
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
what is PhaseIII, ODS, TLG, Macro and Proc in SAS
Mention the difference between ceil and floor functions in sas?
For what purposes have you used sas macros? : sas-macro
describe about metadata object? : Sas-di
How to specify variables to be processed by the freq procedure?
what is intially documentation in sas?
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
what r the job openings SAS for fresher graduates !
what is star schema? : Sas-di
what is transformation in sas data integration? : Sas-di
How long can a macro variable be? A token? : sas-macro
what is broad cast agent? : Sas-bi
What is the difference between reading data from an external file and reading data from an existing data set?
describe how to adjust the performance of data integrator? : Sas-di