DATA Step, Macro, Functions and more

DM command does not work in unix/linux SAS

Reply
Trusted Advisor
Posts: 1,128

DM command does not work in unix/linux SAS

Dear all,

This is with regard DM command, i use the DM command to clear the log and output before the execution of program, something like below

dm 'clear log;clear output';

this clears the log and output content when executed in the sas interactive mode. However when the same code is executed in unix/linux sas batch submission it does not work.

could you please let me know if there is any way to make this dm command work in unix sas batch submission or if there is any alternative code for them in unix sas.

Any suggestions are appreciated.

Thanks,

Jag

Thanks,
Jag
Super User
Posts: 10,483

Re: DM command does not work in unix/linux SAS

I'm kind of confused. The DM commands are intended for use with the Display Manager, i.e. interactive mode. Since true batch mode is generally run without the DM what would you actually be clearing?

If this related to saving only some of the generated output you may look into PROC PRINTTO and routing desired output.

Trusted Advisor
Posts: 1,128

Re: DM command does not work in unix/linux SAS

i want to clear output generated by some procedure with the next procedure in the output lst file.

For example, consider that we have two print procedures, if submitted in a single code one followed by other. Both, data of air and class will be printed in the output. i wish to clear the output printed by air , so that in the output lst file only output of class will be there.

proc print data=sashelp.air;

run;

proc print data=sashelp.class;

run;

Thanks,
Jag
Super User
Super User
Posts: 7,395

Re: DM command does not work in unix/linux SAS

Hi,

If you don't want the output, don't put in the print procedure?  The point being is you have told SAS to print data twice, without specifying and output destination, hence SAS defaults to printing twice to the batch output file.  So either don't print both or re-direct the output via proc printto as ballardw has mentioned.

To add, there is a difference in operation.  Interactive is more of a debug environment, run individual steps, clearing things etc. where batch is a case of take whole program, run everything, any log goes to the default log file, any output goes to the default output file - unless you actually tell it not to.

Ask a Question
Discussion stats
  • 3 replies
  • 630 views
  • 0 likes
  • 3 in conversation