jeudi 30 juin 2016

Pick random observation for each by group in SAS

I have two datasets: form and pool having similar table structure.

a) Dataset form enter image description here

b) Dataset pool pool dataset

  • List item

The above two datsets have three columns where each Key and Level combination in form dataset have 4 rows.

  • List item

Also Sub-Level data in form and pool data is mutually exclusive at Key and Level level.

  • Sub-Level values has a particular Level assigned to them i.e. Level and Sub-Level follows a hierarchy.

I want to populate the null values under Sub-Level column in form dataset with Sub-Level values in pool dataset where a Sub-Level in pool dataset shoud belong to same Key and Level of form dataset.

How can be this done in SAS ?




Aucun commentaire:

Enregistrer un commentaire