I have a dataset that looks similar to the below:
ID COL70 COL71 COL72 COL73 COL74
1 4 3 2 -998 .
2 2 0 2 1 -998
3 1 -998 -998 . .
4 3 4 -998 -998 -998
What I want to do is have a new columns lets call it NEWCOL that has the first non negative value looking backwards from COL74, so it would look as follows:
ID COL70 COL71 COL72 COL73 COL74 NEWCOL
1 4 3 2 -998 . 2
2 2 0 2 1 -998 1
3 1 -998 -998 . . 1
4 3 4 -998 -998 -998 4
I'm working from WPS so this would need to be in SAS or PROC SQL please.