BookmarkSubscribeRSS Feed
srikanthyadav44
Quartz | Level 8

dear all 

i have the dataset of 4,202 companies having the data of their industry code(NIC code), market capitalization and whether the company ESG group or not. the given below is the format of my dataset

company_namenicmcapESG_company
A D F Foods Ltd.1017874.78NON_ESG
Agro Tech Foods Ltd.1020365.39NON_ESG
Ajanta Soya Ltd.101142.86NON_ESG
Ajooni Biotech Ltd.10304.17NON_ESG
Amrit Corp. Ltd.102096.38NON_ESG
Andrew Yule & Co. Ltd.109656.78NON_ESG
Anjani Foods Ltd.101226.96NON_ESG
Apex Frozen Foods Ltd.106481.25NON_ESG
Avadh Sugar & Energy Ltd.103704.41NON_ESG
Avanti Feeds Ltd.1056490.84NON_ESG
B & A Ltd.10459.42NON_ESG
B C L Industries Ltd.102580.43NON_ESG
Bajaj Hindusthan Sugar Ltd.107022.4NON_ESG
Balrampur Chini Mills Ltd.1045045NON_ESG
Bambino Agro Inds. Ltd.101360.7NON_ESG
Bannari Amman Sugars Ltd.1019777.3NON_ESG
Bengal Tea & Fabrics Ltd.10348.53NON_ESG
Britannia Industries Ltd.10873526.94ESG
C C L Products (India) Ltd.1031135.18NON_ESG
Chordia Food Products Ltd.10402.83NON_ESG
Coastal Corporation Ltd.101826.07NON_ESG
D C M Shriram Inds. Ltd.103269.17NON_ESG
D F M Foods Ltd.1018345.1NON_ESG
Dalmia Bharat Sugar & Inds. Ltd.1015105.3NON_ESG
Dangee Dums Ltd.101328.8NON_ESG
Datiware Maritime Infra Ltd.1095NON_ESG
Davangere Sugar Co. Ltd.10818.56NON_ESG
Dhampur Sugar Mills Ltd.1012138.97NON_ESG
Dharani Sugars & Chemicals Ltd.10215.14NON_ESG
Dhunseri Tea & Inds. Ltd.101804.3NON_ESG
Diana Tea Co. Ltd.10243.6NON_ESG
Diligent Industries Ltd.10187.55NON_ESG
Dwarikesh Sugar Inds. Ltd.105799.69NON_ESG
E I D-Parry (India) Ltd.1056411.54NON_ESG
Euro India Fresh Foods Ltd.101915.8NON_ESG
Foods & Inns Ltd.102738.4NON_ESG
Gayatri Bioorganics Ltd.10507.4NON_ESG
Gayatri Sugars Ltd.1081.29NON_ESG
Gillanders Arbuthnot & Co. Ltd.10903.31NON_ESG
Godrej Agrovet Ltd.10100669.68NON_ESG
Gokul Agro Resources Ltd.102667.58NON_ESG
Goodricke Group Ltd.104511.16NON_ESG
Grob Tea Co. Ltd.10933.76NON_ESG
Gujarat Ambuja Exports Ltd.1029337.72NON_ESG
Hindustan Foods Ltd.1044594.4NON_ESG
Indian Sucrose Ltd.10350.21NON_ESG
James Warren Tea Ltd.10671.07NON_ESG
Jay Shree Tea & Inds. Ltd.101912.41NON_ESG
Jayant Agro-Organics Ltd.104084.5NON_ESG
Jhandewalas Foods Ltd.1089.27NON_ESG
Joonktollee Tea & Inds. Ltd.10448.19NON_ESG
Jubilant Foodworks Ltd.10384293.84ESG
K C P Sugar & Inds. Corpn. Ltd.101669.59NON_ESG
K M Sugar Mills Ltd.101072.72NON_ESG
K S E Ltd.107359.84NON_ESG

 

i have to identify the peer group companies in three levels based on their market capitalisation. in level 1, i have identify the Non-ESG companies which are nearest to ESG companies based on their market capitalization i.e, one nearest higher market capitalisation company and one nearest lower market capitalization company. 

in level 2, second nearest companies and level 2 third nearest companies, i have to identify in the same manner. 

My final output format should be like this 

please suggest me the suitable SAS code 

ESG_companies Non_ESG_companies peer group level
Britannia Industries Ltd.Bengal Tea & Fabrics Ltd.1
Britannia Industries Ltd.C C L Products (India) Ltd.1
Britannia Industries Ltd.Bannari Amman Sugars Ltd.2
Britannia Industries Ltd.Chordia Food Products Ltd.2
Britannia Industries Ltd.Bambino Agro Inds. Ltd.3
Britannia Industries Ltd.Coastal Corporation Ltd.3

thanks in advance 

2 REPLIES 2
andreas_lds
Jade | Level 19

@srikanthyadav44 wrote:

......

please suggest me the suitable SAS code 

 

thanks in advance 


Please post data in usable form!

And show the expected result using the posted data, also add an example explaining how (at least) one observation is created in the expected dataset.

AMSAS
SAS Super FREQ

Please provide your have/want dataset in SAS code (example below), so we can quickly generate them in SAS. If you already have datasets then you can use the following link to generate code:

Data2DataStep Maco instructions

data have ;	
	infile cards ;
	input var1 var2 ;
cards ;
1 2
3 4
5 6
;
run ;

I do not understand your want data example, where are these individual letters ("A", "B", "C", "X", "Y") coming from? They are not in your have data.
If you have already attempted this, then the code you used would also be helpful to determine what you are trying to do.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2 replies
  • 376 views
  • 0 likes
  • 3 in conversation