BookmarkSubscribeRSS Feed
Ranjeeta
Pyrite | Level 9

Hello folks,

 

I run the code below and get no errors but it is not resulting in the expected output

Is the code technically correct?

 

data mitra1617;
set dad.dad1617;
ARRAY ARRAY_IC [20] INTERV_CODE_01- INTERV_CODE_20;
if PROVINCE_ISSUING_HCN='ON' and RESPONSIBILITY_FOR_PAYMENT='01' and HCN_INDEX='H'
and AGE >=18 ;
DO I=1 TO 20;

IF SUBSTR(ARRAY_IC[I],1,5) ='1HU80' THEN output;

END;

4 REPLIES 4
PaigeMiller
Diamond | Level 26

@Ranjeeta wrote:

 

but it is not resulting in the expected output

 


Explain this further. Show us the output that is not what you expect, and show us what you do expect.

--
Paige Miller
Reeza
Super User
A code can be correct syntax wise, but that doesn't mean the logic is correct. So I suspect an issue you're seeing here is duplicate records being output? Otherwise, without knowing what logic you're trying to implement we can't really answer that question.
Shmuel
Garnet | Level 18

Please post: 

(1) a sample of your data

(2) The output of that sample

(3) Point which output is not expected and explain why

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 845 views
  • 5 likes
  • 5 in conversation