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 🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 2031 views
  • 0 likes
  • 2 in conversation