Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Developing a Looping / Macro process in SAS Enterprise Miner

Reply
New Contributor
Posts: 2

Developing a Looping / Macro process in SAS Enterprise Miner

Greetings,

Grateful for your attention, I would like to ask for some advisory with the SAS Enterprise Miner product:

I have the following  kind of files (example):

y1995m01w04d29.pdf

y1995m01w05d30.pdf

y1995m01w05d31.pdf

y1995m02w05d01.pdf

...

y1995m12w52d31.pdf

This means the first file belongs to the year 1995, month 01 = January, fourth week of the studied data base and it is the 29th of January to be precise.

I am currently performing Text Mining procedures with a data base that has daily files for year 1995.

I wanted to ask if it is possible to create a macro or a loop that:

-Runs the Import File node to the files that cover a certain characteristic in the file name (for example, run the Import File node only to the pdf files whose name contains "w04".

-After running the Import File node , runs the Text Parsing node to the imported files and save the results in a csv file.

-After running the Text Parsing node, runs the Text Filtering node to the parsed files and save the results in a csv file.

The procedure would need to repeat for every week, therefore first it would need to run for the files that contain "w01" in their name, then "w02" and so on.

Thank you before hand for your attention and time.

Super Contributor
Posts: 336

Re: Developing a Looping / Macro process in SAS Enterprise Miner

The macro would be a really elegant solution. Maybe creating a model package would be one way to go.

If you are only going to do this weekly, one approach would be to save the xml of your diagram (right click and select Save diagram as) and import it later (import from XML).

Modifying the Import File and the Save Data nodes seems almost as easy as having a macro that needs file name and results as macro parameters.

What do you think?

Thanks,

Miguel

New Contributor
Posts: 2

Re: Developing a Looping / Macro process in SAS Enterprise Miner

Hello Miguel,

Thank you for your advice!

I will try this and see how it goes.

Thank you for your time.

Ask a Question
Discussion stats
  • 2 replies
  • 416 views
  • 0 likes
  • 2 in conversation