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

what is fact table and factless table?

1 Answers  


Please write codes to merge two datasets and keep every record in the first dataset.

1 Answers  


How to include or exclude specific variables in a data set?

0 Answers  


What is difference between sas rename and lable?

4 Answers  


Of all your work, where have you been the most successful?

0 Answers   Oracle, Six Sigma,






how do you want missing values handled? : Sas programming

0 Answers  


how to remove the duplicates by proc sql?

2 Answers   Genpact,


What is shift table? have you ever created shift that?

2 Answers   Accenture, Clinical Research, Quintiles,


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

0 Answers  


Hi... this is chandu, did MSc Microbiology, trying to get job in SAS tool, PLZ Tell me whether IT industries will give consider my education to gain a job....?

2 Answers  


what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi

0 Answers  


here is a string like chq.2312244%4452- from that i want only special characters in a column. dont use compress. bcoz i have 1.2 billion of records.i want another process to find the values instant from the data.

2 Answers   Cap Gemini, L&T,


Categories