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.
Answer / aravind rangaraj
if u result look like as follows,its correct result only..
just chk d info observation by observation..
each date in data1 is satisfied..u r confused????
if any output u hav expected just write the output..
output:
dt account startdt enddt total
11OCT1964 1230 15JUL1964 08JAN1965 12300
22OCT1964 1120 15JUL1964 08JAN1965 12300
23NOV1964 1130 15JUL1964 08JAN1965 12300
02NOV1964 1240 15JUL1964 08JAN1965 12300
11OCT1964 1230 06APR1964 24OCT1964 16800
22OCT1964 1120 06APR1964 24OCT1964 16800
Is This Answer Correct ? | 1 Yes | 2 No |
In sas, what are the areas that you are most interested in? : sas-grid-administration
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
How is character variable converted into numeric variable and vice versa?
Which date functions advances a date time or date/time value by agiven interval?
1.How to draw pivot tables in Excel by using SAS and in which version we can use VB script for to draw pivot tables in Excel? Answer with example data. 2.What are the advantages of _NULL_ in Data steps? Can we use _NULL_ in Proc steps also? 3. How to call the macro variable into Data Steps? 4. Can we draw pivot tables in Excel using Proc SQL? Please post answers for the above questions with suitable examples, and how to use VB script for Excel using SAS.
how can you get the single data set from the library(which has the number of data sets)?
3 Answers Accenture, Deloitte,
Mention sas system options to debug sas macros.
it will become easy if uuu provide website linkssss and list of consultanciessssss
Have you ever linked SAS code, If so, describe the link and any required statements used to either process the code or the step itself?
Explain the main difference between the sas procedures and functions? : Sas-administrator
Mention few ways with which a “table lookup’ is done in sas programming.
If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn’t have a value?