BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

Is there a solution or possibility to „see-print“ Infomap FILTER definition from SAS BASE as valid SAS WHERE statement?
I mean
- print to log or
- save to macro variable.

PROC INFOMAPS allows to list filter definition to log, but not as valid SAS WHERE statement.
E.g.:

Filter name: RULE0004
ID: RULE0004
Folder: /Rules/Finished
Description: PU in Last Year
Expression: ( <<root.Dat Vznik Pu>> BETWEEN Previous 1 Year From {Beginning of Year From
{TODAY()}} AND TODAY() )

Listed expression is not valid SAS code 😞

Thanks,
Matej
12 REPLIES 12
Cynthia_sas
SAS Super FREQ
Hi:
You can cut and paste from the Test Information Map --> View Query mode, however, I'm not aware of a way to generate a --resolved-- WHERE clause from the Information Map programmatically.

This is a good question for Tech Support.

cynthia
deleted_user
Not applicable
Thank you for answer, but I need to do it programmatically Customer has 100 and more filters defined in Info Map and we need to use them in DW batch jobs like:

DATA x;
SET y;

IF filter1 then rcf1 = 1;
Else rcf1 = 0;

IF filter2 then rcf2 = 1;
Else rcf2 = 0;

…….

IF filter100 then rcf100 = 1;
Else rcf1000 = 0;

RUN;

Matej
Cynthia_sas
SAS Super FREQ
As I said, this is probably a good question for Tech Support.

cynthia
deleted_user
Not applicable
I would suggest you begin by reading the Base SAS infomaps documentation.

http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/base_infomap_9951.pdf

Then you will probably need to do some experimentation on your own.

The point of the infomap is that it holds the metadata, which includes the filter.
The point of SAS providing an infomap is for you to be able to use it directly.
The way SAS provides this use is through a LIBNAME statement that uses the INFOMAP engine to access the infomap. The filter will then automatically be applied when you read the data through the LIBREF you created with the LIBNAME statement.
deleted_user
Not applicable
PDF 9951 is for beginners. I need something more:-(
Imagine.
You have filter created from 40 different variables. Yes it’s true. Business user can use directly filter in BASE through a LIBNAME statement or he can use EG, but there is no information in log about subset condition.
What is only available in LOG is rule name. Result is that marketing manager will get subset of database, but has no clue under which conditions it was created:-(
deleted_user
Not applicable
Isn't the point behind the information maps and metadata to hide the underlying programming details? If the rules are properly defined, and the correct source is used, then the right stuff is supposed to come out (of course there is always the garbage in, garbage out snafoo).

So, where are you going with this?
What are you really trying to do?
deleted_user
Not applicable
Fraud Detection Project. The most important things are rules. Rules to find, mark “suspect” transaction. You have to manage all these rules(hundreds) somewhere and then use them in batch job to score all new daily transaction.
Information map studio seems to be fine for managing rules, filters as InfoMap. MS positive user can easily create complicated rules without SAS coding knowledge. I need to uses all defined filters as IF statement in data step to score. And this is my problem 🙂

Of course when all rules are defined in IM Studion, business user can use them in EG for daily reporting. E.g.: Report for RULE123 (EUR>2500 BANK=CYPRUS)

Matej
deleted_user
Not applicable
I beginning to get a glimmer of understanding.

The information map rules apply to getting stuff into, out and around the system.
What you want to do is find the stuff that fails the rules.
Is that correct?
deleted_user
Not applicable
No. I want to use filter definition in SAS BASE. But not as DATA SET option.
That is. Nothing more. It is simple, transparent.

If it is not possible to use filter in BASE except DS option, sad but OK.

BUT!
SAS Information Maps are stored in the central SAS Metadata Repository. And there is SAS Open Metadata Interface. There must be way how to get information I need. I can read any filter from every defined InfoMap through Open Metadata Interface, no problem.
Problem is: filter definition is not stored as valid SAS statement. I need to know how get through Open Metadata Interface filter definition as valid SAS statement or how to translate it. Easy.

M.
deleted_user
Not applicable
Filter rules say
1) this is ok, pass it on
or
2) This is not ok, drop it, don't pass it on.

Oh, wait, maybe this is it.

You do not want to simply pass the data through the filters, but to score each transaction based on the set of rules so that you can report on, say, a distribution of transactions vs. scored values.

And your problem is that you need to parse the metadata rules so that you can recognize when a transaction meets or fails a particular rule.

Am I understanding you now?
deleted_user
Not applicable
I think yes. Imagine you have DataMart 10GB. 100+ filters. With DS filter option you have to run 100+ data steps + one to put all together:-(
deleted_user
Not applicable
To list filter definition set

OPTION SASTRACE = ',,,d' SASTRACELOC = saslog nostsuffix;

before sql or data step.

Filter definition will be printed in log.



M.

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