BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
7 REPLIES 7
DanielSantos
Barite | Level 11
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Doc_Duke
Rhodochrosite | Level 12
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
deleted_user
Not applicable
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.
LinusH
Tourmaline | Level 20
To avoid writing multiple conditional statement, you could use an array approach, and accordingly within a do loop.

/Linus
Data never sleeps
deleted_user
Not applicable
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
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1050 views
  • 0 likes
  • 5 in conversation