User:LainieH/test page

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

You can use regular expressions to test/validate the format of ICD-9 diagnosis codes. For example:

  data probably_good_codes(drop = match_loc) obviously_bad_codes ; 
    retain rgx_handle ; 
    set my_dataset ; 
    if _n_ = 1 then do ; 
      rgx_handle = prxparse("/^(V\d{2}(\.\d)?|\d{3}(\.\d{1,2})?|E\d{3}(\.\d)?)/") ; 
    end ; 
    match_loc = prxmatch(rgx_handle, dx) ; 
    if match_loc = 1 then output probably_good_codes ; 
    else output obviously_bad_codes ; 
  run ;

View the read more link for details about the PRX logic.

Submitted by Roy Pardee. Contact me at my Discussion Page.



Feel free to comment on this tip.




Check out the Tip of the Day page for details about this effort.



View the web-site usage statistics and the definition of terms used in that report.