BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
	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

 

 

4 REPLIES 4
andreas_lds
Jade | Level 19

Are there any unexpected notes, warnings or errors in the log? If so, please post the log as text using "insert code" button.

Kurt_Bremser
Super User

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
Lapis Lazuli | Level 10
Post output what you have got
I want all countries in both regions
Kurt_Bremser
Super User

@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;

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 790 views
  • 0 likes
  • 3 in conversation