DATA Step, Macro, Functions and more

View Filter Definition [Information Map] from SAS BASE

Reply
N/A
Posts: 0

View Filter Definition [Information Map] from SAS BASE

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
SAS Super FREQ
Posts: 8,868

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to Cynthia_sas
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
SAS Super FREQ
Posts: 8,868

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
As I said, this is probably a good question for Tech Support.

cynthia
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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:-(
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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?
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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?
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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?
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
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:-(
N/A
Posts: 0

Re: View Filter Definition [Information Map] from SAS BASE

Posted in reply to deleted_user
To list filter definition set

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

before sql or data step.

Filter definition will be printed in log.



M.
Ask a Question
Discussion stats
  • 12 replies
  • 227 views
  • 0 likes
  • 2 in conversation