BookmarkSubscribeRSS Feed
shellp55
Quartz | Level 8

Hello

 

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.

 

9 REPLIES 9
shellp55
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.

shellp55
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.  

Kurt_Bremser
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.

shellp55
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.
shellp55
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.

 

Ksharp
Super User

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

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!

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.

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
  • 9 replies
  • 987 views
  • 0 likes
  • 3 in conversation