BookmarkSubscribeRSS Feed
omega1983
Calcite | Level 5

data loans(keep=loan_num log_code filter);

set loan1;

run;

Here is the scenario for the log codes.

if the log code is

TLS only (log code) – Received tab

TLS and TCD (log codes) – Pending

TLS and TMOD (log codes) – Reset

The issue is TLS can appear in all three scenarios, in scenarios 2 and 3, the second log code dictates the tab.

if log code = 'TLS' and log code not in ('TCD','TMOD') the filter = 'TLS';

if log code in('TLS','TCD)

I want the filter to populate with Received, Pending or Reset.  What complicates this is TLS can appear in all 3 scenarios.

2 REPLIES 2
ballardw
Super User

Are those actual data lines? If not actual, or at least the way it actually will appear in the data would be more helpful.

If log code in ('TLS','TCD')  won't do what you want as this is true if the entire code is either of these values.

you may be looking for

if findw(Log_code,'TLS')>0 and findw(Log_code,'TCD')>0 then filter='Pending';

Peter_C
Rhodochrosite | Level 12

Does this data have key (or id) columns to group by?

I'm assuming when a group has the appropriate collection it belongs in one of the three tabs.

The design i would propose makes a join of 3 streams having just one type of data in each stream. But that approach needs a definition of the grouping.

With ordered data the 3 tabs could be written by a single data step. Proc sql wouln't need ordered data but can only write one tab at a time.

peterC

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!

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
  • 2 replies
  • 731 views
  • 0 likes
  • 3 in conversation