Hello all,
I have two Data Bases that store a field room, one has it with leading zeros and one without, the hitch is these rooms can have a alpha charater? any ideas?
I had some 1100 false positives now with this just a 100 or so
I came up with this:
put(input(a.room,best4.),z4.) <> put(input(b.room,best4.),z4.)
I started with:
a.room <> b.room
but with data like:
a.room b.room
451a 0451a
451b 0451b
1 00001
21 00021
1-1 001-1
I am not sure what to try to get them down to the true diffences that I want. TIA -KJ
PRX functions can be handy,
data have;
input aroom$ broom$;
_b=prxchange('s/(^0*)([^0]+.+)/$2/o',-1,broom);
equal_or_not=ifc(aroom=_b,'Y','N');
cards;
451a 0451a
451b 0451b
1 00001
21 00021
1-1 001-1
451a 0451c
;
PRX functions can be handy,
data have;
input aroom$ broom$;
_b=prxchange('s/(^0*)([^0]+.+)/$2/o',-1,broom);
equal_or_not=ifc(aroom=_b,'Y','N');
cards;
451a 0451a
451b 0451b
1 00001
21 00021
1-1 001-1
451a 0451c
;
data have; input aroom$ broom$; equal_or_not=(aroom=prxchange('s/^0+//',-1,broom)); cards; 451a 0451a 451b 0451b 1 00001 21 00021 1-1 001-1 451a 0451c ; run;
Just a check, but You know that <> is max in SAS?
In most languages it means Not Equals and from your usage it looks like that's what your using it for?
The MIN and MAX operators are used to find the minimum or maximum value of two quantities. Surround the operators with the two quantities whose minimum or maximum value you want to know. The MIN (><) operator returns the lower of the two values. The MAX (<>) operator returns the higher of the two values.
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm
Yes I am aware that <> is max, but in "proc sql" it works and works with SQL queries diectly thus we use it... I have been burned by it in data steps so it is playing a bit with fire.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.