data jagan1.s;
input bp$;
cards;
100/90
120/89
112/87
run;
in the above code how to convert character data values to numeric data values?

Answers were Sorted based on User's Feedback



data jagan1.s; input bp$; cards; 100/90 120/89 112/87 run; in the above code how to convert..

Answer / hny135

DATA JAGAN1.S1;
SET JAGAN1.S;
X=SCAN(BP,1,'/');
Y=SCAN(BP,2,'/');
A=INPUT(X,3.);
B=INPUT(Y,2.);
DROP BP X Y;
RUN;

Is This Answer Correct ?    7 Yes 1 No

data jagan1.s; input bp$; cards; 100/90 120/89 112/87 run; in the above code how to convert..

Answer / aaaa

data jagan1.s;
infile cards dlm='/' dsd;
input b p;
cards;
100/90
120/89
112/87
run;

Is This Answer Correct ?    0 Yes 0 No

data jagan1.s; input bp$; cards; 100/90 120/89 112/87 run; in the above code how to convert..

Answer / srinivasa rao

Using input function

data jaganl.1;
input bp$;
a=input(bp);
cards;
100/90
120/89
112/87
;
run;

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More SAS Interview Questions

How will you assign all the variables of an dataset into a macro variable separated by a space? For example if a dataset has variables A,B,C. Assign them to a macro variable X as X=A B C

3 Answers   Accenture, Oracle,


What is maximum storage capability of SAS?

0 Answers  


How do you read in the variables that you need?

5 Answers  


How to write duplicate records into a separate dataset using sort?

4 Answers   HSBC,


How do dates work in sas?

0 Answers  






how will you location sas platform applications available from web browser? : Sas-bi

0 Answers  


what is sas enterprise intelligence architecture? : Sas-bi

0 Answers  


how do i read multiple spaces in datasets? eg: vijaya raghava perumal.I tried with using & but it workss if its vijaya raghava but not for raghava perumal.how to do this?

8 Answers   Wipro, Xansa,


what is ae onset date n what is RDS

0 Answers   Accenture,


What is the basic structure of a sas program?

0 Answers  


how sas deals with business intelligence? : Sas-bi

0 Answers  


where are dashboard components are created and maintained? : Sas-bi

0 Answers  


Categories