BookmarkSubscribeRSS Feed
Quartz | Level 8



I am using SAS 9.4.


I have a program called "regroup" that indicates the location of two sets of text documents plus an export file name as %let export_file:

Libname mylib 'C:\SAS Datasets';
filename M_regrp('C:\text data\monthly\.*txt';
filename Y_regrp('C:\text data\yearly\*.txt';
%let export_file="C:\sas_data.mdb";

I wish to call the regroup from another program and pass the 4 settings above from the other program.  How do I do that?  Thanks.


Quartz | Level 8

The report in question (regrp) is actually used for many hospitals and I have them all in the code and just comment out the sites I don't want at the time I run it.  So rather than have multiple copies of regrp to call for each site from this other program, I thought it would be easier to call it from another program that I have to run that uses the resulting dataset from the regrp program.

Quartz | Level 8

Not sure I know what you're asking but each hospital with have a different location for the file location of M_regrp and Y_regrp as well as different locations for the library name and the export_file.  So I want to pass those to the report via the other report that calls the program.  

Super User

Define what the "settings" are in this sentence from your first post:


I wish to call the regroup from another program and pass the 4 settings above from the other program.

Quartz | Level 8
The other program imports data from two locations and merges them, exports to a database and is saved to a specific library.

So I assume I would use %include to indicate the program I want to run, but I want to know how to identify the location of M_regrp and Y_regrp files, the library name to save the dataset to and the database to export the table to. Those are the settings being passed to the called report.
Quartz | Level 8


I wasn't sure about what you were advising but I found that all I needed to do was to copy the filename, libname and let statement for the database to above the %include line and it runs as it should.  Thanks.


Super User

If you have SAS/IML, you could try CALL EXECUTEFILE() .



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 3 in conversation