Help using Base SAS procedures

run a whole bunch of codes fast and efficiently

Reply
N/A
Posts: 0

run a whole bunch of codes fast and efficiently

Hi,

I need your help. I am running many codes for fields such as cpt1 and cpt2 all the way up to cpt6 and I have to run from where cpt1 - cpt6 = (390 - 434) and 436- 459 excluding 401 and 401. I don't want to write many conditional statements so how could I go about capturing all the data. The fields are character such that '390', '391', etc.

Please help.

Thanks.
Super Contributor
Posts: 474

Re: run a whole bunch of codes fast and efficiently

Hello rab.

Could you be more specific about what your trying to do, so we could point you the right direction?...

Are you extracting, merging or transforming this data?

Greetings from Portugal.

Daniel Santos at www.cgd.pt.
Super Contributor
Super Contributor
Posts: 3,174

Re: run a whole bunch of codes fast and efficiently

Also, it may help to convey "brief" INPUT and OUTPUT data examples and how you would like them to appear. You will want to use COPY/PASTE directly into your forum post reply to explain the objectives and data considerations further.

Scott Barry
SBBWorks, Inc.
Trusted Advisor
Posts: 2,113

Re: run a whole bunch of codes fast and efficiently

See Scott Barry's response in

http://support.sas.com/forums/thread.jspa?threadID=5596&tstart=0

The FORMAT approach works very well here.

Doc Muhlbaier
Duke
N/A
Posts: 0

Re: run a whole bunch of codes fast and efficiently

Data is such that:

cpt1` cpt2 cpt3 cpt4 cpt5 cpt6
390 391 392 396 900 397

but many many codes in each column. I just want to flag once if the any of the cpt1-6 are within the range of (390 - 434) and 436- 459.

I would like frequencies or the number of people having atleast one cpt code within the range.

Thank you.
Super User
Posts: 5,256

Re: run a whole bunch of codes fast and efficiently

To avoid writing multiple conditional statement, you could use an array approach, and accordingly within a do loop.

/Linus
Data never sleeps
N/A
Posts: 0

Re: run a whole bunch of codes fast and efficiently

your right linus,
but I am not good at creating the arrays or do loops, could please provide an example using the variables and fields I have.
Rabiya
Super Contributor
Super Contributor
Posts: 3,174

Re: run a whole bunch of codes fast and efficiently

As was mentioned, did you take time to review SAS PROC FORMAT (documentation) in order to code your range values for identifying candidates?

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 7 replies
  • 138 views
  • 0 likes
  • 5 in conversation