Hello All,
I want to combine 2 data sets as below and i am not sure how to use both where and Drop functions together for data set history.adm_ytd_pivot_2017.
It would be great help if you can assist me with this.
data adm_en4; set adm_en3 history.adm_2017(where=( commence_year = '2017')); run;
@BIDD wrote:
Hello All,
I want to combine 2 data sets as below and i am not sure how to use both where and Drop functions together for data set history.adm_ytd_pivot_2017.
It would be great help if you can assist me with this.
data adm_en4; set adm_en3 history.adm_2017(where=( commence_year = '2017')); run;
Just add the drop dataset options:
data adm_en4;
set
adm_en3
history.adm_2017 (
drop=variables you want to drop
where=(commence_year = '2017')
)
;
run;
If you want the where clause applied to all source data sets then you can write your code as below:
data adm_en4;
set adm_en3 history.adm_2017;
where commence_year = '2017';
run;
The way you've done it will only apply the where clause for the data set which goes with the where clause.
Hi,
i want to use Where and drop clause only for history.adm_2017, no changes in adm_en3 data.
Then put them on the set part as you have done:
data adm_en4; set adm_en3 history.adm_2017(where=( commence_year = '2017') drop=...); run;
@BIDD wrote:
Hello All,
I want to combine 2 data sets as below and i am not sure how to use both where and Drop functions together for data set history.adm_ytd_pivot_2017.
It would be great help if you can assist me with this.
data adm_en4; set adm_en3 history.adm_2017(where=( commence_year = '2017')); run;
Just add the drop dataset options:
data adm_en4;
set
adm_en3
history.adm_2017 (
drop=variables you want to drop
where=(commence_year = '2017')
)
;
run;
Hi, thanks for the advice...it worked.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.