BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PratapDeo
Calcite | Level 5

Hello All, I have to execute a file AAA from first job. This file (AAA) is suppoose to be appended i.e. MOD. Can I give like this at the end of the first file "%INCLUDE "AAA.sas" MOD ;

 

Many Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18
Sorry, and why do you need MOD ?
There in no MOD option with %INCLUDE.

View solution in original post

7 REPLIES 7
Shmuel
Garnet | Level 18

If you created AAA.sas file by:

  

data out;
    file 'AAA.sas'   ...any options;
.......
run;

The answer to your question os positive. You can add at end:

    %include 'AAA.sas';

 

In case the creating code is like:

filename outf '..path...AAA.sas';
data out;
    file outf ...any options...;
  .......
run;

You can end by:

%include outf;

Shmuel
Garnet | Level 18
Sorry, and why do you need MOD ?
There in no MOD option with %INCLUDE.
PratapDeo
Calcite | Level 5

Thanks for your reply Shmuel.
When I am using %include 'AAA.sas' ; without MOD option its giving ERROR: File is in use. Seems during the creation of this file (AAA), it it remains open. Do we have to close this file.

Shmuel
Garnet | Level 18

Yes, ofcourse, file should be closed before %include.

PratapDeo
Calcite | Level 5
Can you please help me how we can close the file before %include.
Shmuel
Garnet | Level 18

Did you closed the data step that created the AAA.sas file with RUN

before the %include statement  

PratapDeo
Calcite | Level 5
Oh Gotcha...my issue got resolved ...thanks alot 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1436 views
  • 0 likes
  • 2 in conversation