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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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