How to get any kind of data in SAS? Is it possible to take
data from notepad in SAS?

Answer Posted / naveen

Data sample_accounts;
INPUT Account 1-7 OpenDate $ 9-17 StatusCode $ 21-22
CreditLimit 25-29;
CARDS;
1234670 11-Sep-04 Z 2000
1234671 12-Sep-04 3000
1234672 13-Sep-04 Z 2500
1234673 14-Sep-04 T 3200
1234674 15-Sep-04 8000
run;

filename myfile "C:\Mydata\sample_accounts.txt";
data qqq;
infile myfile dlm=' ';
input Account OpenDate $ StatusCode $ CreditLimit;
run;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are you involved in writing the inferential analysis plan? Tables specfications?

2108


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

1910


Explain the difference between informat and format with an example.

682


Mention the difference between ceil and floor functions in sas?

646


What are the limitations for memory allocation for SAS variables

927






Explain data step in SAS

628


What do you know about symput and symget?

727


In ARRAY processing, what does the DIM function do?

708


what is the use of proc contents and proc print in sas? : Sas-administrator

603


What is the function of output statement in a SAS Program?

609


If you could design your ideal job, what would it look like?

2374


What is a method to debug and test your SAS program?

715


If a variable contains only numbers, can it be a character data type?

611


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4609


data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.

1796