How to create serial columns based on non-missing value?

Reply
Super Contributor
Posts: 309

How to create serial columns based on non-missing value?

Hello,

 

I have a data set, first 2 obs showed in the attachment.  I would like to collect the non-missing values from HSK1-HSK13 and assign to bd_dx_1-bd-dx_7 accordingly.   I have 500 sample ID.  Please advice how to do it.  Thanks.

 

Super User
Posts: 11,107

Re: How to create serial columns based on non-missing value?

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Ask a Question
Discussion stats
  • 1 reply
  • 80 views
  • 0 likes
  • 2 in conversation