What is the purpose of TEST3? Wouldn't it make more sense to get the list of ALL years from test2?
select distinct break as name,year from test2
union
select distinct "ALL" as name,year from test2
Hey Tom,
The issue here is data step will update the value to All when ever it encounters the test3 dataset, But my requirement is after it gets all the data from both the datasets, it should append all value and the year for distinct years in test3 dataset.
@rkarr5 wrote:
Hey Tom,
The issue here is data step will update the value to All when ever it encounters the test3 dataset, But my requirement is after it gets all the data from both the datasets, it should append all value and the year for distinct years in test3 dataset.
Not sure why you would need to use "record" pointers to do that in your existing database. Doesn't it support normal basic SQL code?
create table want as
select distinct x,y from source1
;
insert into want
select distinc 'ALL' as X, Y from source2
;
I still think that it looks like your overall goal is to summarize data and PROC SUMMARY is a great tool to do that.
Thanks Tom. Will check this code. I will try to explore proc summary also.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.