proc import datafile ="C:\Users\Anand\Desktop\covid19 updated_onMar31-2020.xlsx"
out=covid19
dbms=xlsx;
run;
data covid19a;
set covid19;
where Reporting_Country_Territory_Area in ('Western Pacific Region' 'South-East Asia Region');
proc print;
run;
Hi guys
gentle remainder
but i didn't get proper solutions
please find below attachment and i want retrive information
two regions only
'Western Pacific Region' 'South-East Asia Region'
i want above two regions countries data
Are there any unexpected notes, warnings or errors in the log? If so, please post the log as text using "insert code" button.
I stored your Excel file in my UE directory, and ran this:
proc import
datafile ="/folders/myfolders/covid19 updated_onMar31-2020.xlsx"
out=covid19
dbms=xlsx
replace
;
run;
data covid19a;
set covid19;
where Reporting_Country_Territory_Area in ('Western Pacific Region' 'South-East Asia Region');
run;
proc print data=covid19a noobs;
run;
and I got the two observations that match your WHERE condition.
@BrahmanandaRao wrote:
Post output what you have got
I want all countries in both regions
With the current structure, this is not possible. It seems that you need to convert a report-style layout to a correct table:
proc import
datafile ="/folders/myfolders/covid19 updated_onMar31-2020.xlsx"
out=covid19
dbms=xlsx
replace
;
run;
data covid19_expanded;
length region $47;
set covid19;
retain region;
if
total_confirmed_cases = . /* "region" line */
then do;
if reporting_country_territory_area ne "Territories**"
/* otherwise the two "Territories**" groups form their own region */
then region = reporting_country_territory_area;
delete; /* we don't want this extra observation in the dataset */
end;
run;
data want;
set covid19_expanded;
where region in ('Western Pacific Region' 'South-East Asia Region');
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.