|
On Feb 15, 2:40 pm, xlr82sas <xlr82...@aol.com> wrote:
> On Feb 15, 10:20 am, j...@STANFORDALUMNI.ORG (Jack Hamilton) wrote:
>
>
>
>
>
> > What do you mean by "didn't work"? It didn't compile? It ran but the results were incorrect? And if wrong, in what way? It would probably help to show your code before and after the change, and the SAS log.
>
> > --
> > Jack Hamilton
> > j...@alumni.stanford.org
> > Caelum non animum mutant qui trans mare currunt.
>
> > On Feb 12, 2010, at 12:01 pm, SAS MAN wrote:
>
> > > Hi Folks,
> > > I have a situation here where I need to flag each column compared with
> > > a source column and flag each column if they have a different value
> > > compared to the source column.
>
> > > Below is the code I use for comparing PHY with HV_TEL and EKG but now
> > > the case is I would also like to compare GRIP alos. I tried adding an
> > > additional IF - then statement which didn't work. So I was wondering
> > > if some one can help me out here. Thanks for you time
>
> > > Regards, MAtt
>
> > > proc report data=Teleforms nowd;
> > > column IDNO VI NAME ODV HV_TEL EKG GRIP PHY ;
> > > define IDNO / order 'BLSAID';
> > > define VI / order 'VISIT';
> > > define NAME / display 'NAME';
> > > define ODV / display 'Date of Visit';
> > > define HV_TEL / display 'PACK - T';
> > > define EKG / display 'EKG -DB';
> > > define PHY / display 'PHYSICAL EXAM -DB';
>
> > > compute PHY;
> > > if PHY=HV_TEL then do;
> > > if EKG = HV_TEL then do;
> > > call define("HV_TEL",'style','style={background=white }') ;
> > > call define("EKG",'style','style={background=white}');
> > > call define(_COL_,'style','style={background=white }') ;
> > > end;
> > > else if EKG ne HV_TEL then do;
> > > call define("HV_TEL",'style','style={background=red
> > > font_weight=bold }') ;
> > > call define("EKG",'style','style={background=pink
> > > font_weight=bold}') ;
> > > call define(_COL_,'style','style={background=red
> > > font_weight=bold}') ;
> > > end;
> > > end;
>
> > > else if PHY ne HV_TEL then do;
> > > if EKG = HV_TEL then do;
> > > call define("HV_TEL",'style','style={???}') ;
> > > call define("EKG",'style','style={???}') ;
> > > call define(_COL_,'style','style={???}') ;
> > > end;
> > > else if EKG ne HV_TEL then do;
> > > call define("HV_TEL",'style','style={???}') ;
> > > call define("EKG",'style','style={???}') ;
> > > call define(_COL_,'style','style={???}') ;
> > > end;
> > > end;
>
> > > endcomp;- Hide quoted text -
>
> > - Show quoted text -
>
> Hi,
>
> The seenum and seechar can sometimes help to debug compute blocks:
> It puts results of each iteration in the log.
>
> /* T000013 PUTLOG IN A PROC REPORT COMPUTE BLOCK SEENUM AND SEECHAR
> FUNCTIONS VERY USEFUL FOR DEBUGGING */
> proc report data=sashelp.class nowd list;
> columns _all_;
> compute weight;
> _n_ + 1;
> rcN = seenum(_n_, 'NOTE: OBS');
> rcN = seenum(weight.sum,' WEIGHT');
> rcC = seechar(name,' NAME');
> endcomp;
> run;quit;
>
> http://homepage.mac.com/magdelina/.Public/utl.html
> utl_tipweb.txt- Hide quoted text -
>
> - Show quoted text -
Just a note
Most of my tips are shamelessly stolen from SAS-L and the web. I try
to acknowledge the authors but unfortunately some of the tips are so
old that I cannot remember the source.
I used these tips for my own purposes, but recently decided to compile
them.
Regards
|