Desktop productivity for business analysts and programmers

Insert a plus sign before a computed variable

Reply
Occasional Contributor
Posts: 9

Insert a plus sign before a computed variable

Hi all,

I put together a program to display Progression Free Survival (PFS) and Overall Survival (OS) for a listing, i.e. it displays these results as a number of days, 25, 110, etc. One of the requests from a reviewer (and common in these types of listings) is to display a + before the results if the subject is still alive, e.g. Subj 001 PFS = +99 (still alive) vs. Subj 002 PFS = 99 (died). I'm at a loss as to how to do this other than I know I'll have to check whether my Date of Death is either null or present. Any ideas?

Thanks!

John
Valued Guide
Posts: 2,111

Re: Insert a plus sign before a computed variable

You could create a format for your death indicator that assigns a value of + for alive and blank otherwise and then just print the two columns side-by-side.

If the people receiving the listing are picky and insist on numbers like you displayed, you could create a display field that is text and a combination of the indicator and the number, something like
length OSdisp $ 5;
FORMAT osdisp $char5.;
OSdisp=RIGHT(AliveAsPlus||LEFT(PUT(os,3.)));
Occasional Contributor
Posts: 9

Re: Insert a plus sign before a computed variable

Thanks Doc!

I'll give it a shot.

John
Ask a Question
Discussion stats
  • 2 replies
  • 237 views
  • 0 likes
  • 2 in conversation