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 does sas handle missing values in procs? : Sas programming

0 Answers  


Below is the table. Required to be output should be the highest number of each student_id. Example. Student_id Subject Marks 1 Hindi 86 2 Hindi 70 3 English 80 . Calculate sum and average marks for each group of student_id Example. Student_id Subject Marks Total Marks Average 1 English 40 181 60.33333 2 English 67 196 65.33333 3 English 80 160 53.33333 PLEASE PROVIDE THE CODE OF ABOVE PROBLEMS

1 Answers   Accenture, HSBC,


what are system option ? give few examples ? what are dataset options and dataset statements ? if there is a keep option and keep statement ? which one is executed first ? Difference between a WHERE statement and IF statement ? what is the advantage of using WHERE statement option on the dataset ?

1 Answers   Satyam,


Give some ways by which you can define the variables to produce the summary report (using proc report)?

0 Answers  


Explain the message 'Merge has one or more datasets with repeats of by variables'.

5 Answers  






What is the use of PROC gplot?

0 Answers  


What are the difference between ceil and floor functions in sas?

0 Answers  


In the flow of DATA step processing, what is the first action in a typical DATA Step?

9 Answers  


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

0 Answers  


Name statements that function at both compile and execution time.

3 Answers   L&T,


Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.

0 Answers  


how do the in= variables improve the capability of a merge? : Sas programming

0 Answers  


Categories