DATA Step, Macro, Functions and more

Appending a SAS program while running (on Linux)

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Appending a SAS program while running (on Linux)

[ Edited ]

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


Accepted Solutions
Solution
‎08-24-2017 01:47 AM
Trusted Advisor
Posts: 1,848

Re: Appending a SAS program while running (on Linux)

Sorry, and why do you need MOD ?
There in no MOD option with %INCLUDE.

View solution in original post


All Replies
Trusted Advisor
Posts: 1,848

Re: Appending a SAS program while running (on Linux)

Posted in reply to PratapDeo

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;

Solution
‎08-24-2017 01:47 AM
Trusted Advisor
Posts: 1,848

Re: Appending a SAS program while running (on Linux)

Sorry, and why do you need MOD ?
There in no MOD option with %INCLUDE.
Occasional Contributor
Posts: 15

Re: Appending a SAS program while running (on Linux)

[ Edited ]

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.

Trusted Advisor
Posts: 1,848

Re: Appending a SAS program while running (on Linux)

Posted in reply to PratapDeo

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

Occasional Contributor
Posts: 15

Re: Appending a SAS program while running (on Linux)

Can you please help me how we can close the file before %include.
Trusted Advisor
Posts: 1,848

Re: Appending a SAS program while running (on Linux)

Posted in reply to PratapDeo

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

before the %include statement  

Occasional Contributor
Posts: 15

Re: Appending a SAS program while running (on Linux)

Oh Gotcha...my issue got resolved ...thanks alot Smiley Happy
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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