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.
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';
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.