BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a working SAS program as below(basically uses proc sql to get metadata
for each dataset whose name appears in files dataset
------------------------------------------------------------------------------------------------
data _null_;

set files;

%let libLoc = TRIM(parentFolder);
%let dsName = TRIM(datasetName);
%let uDSName = UPCASE(&dsName);
%let opFile = TRIM(outputFileNameCSV);


%let tempLine = 'LIBNAME sasdata2 '''||&libLoc||''';' || 'data _NULL_;' || 'set sasdata2.'||&dsName||';' || 'run;' || 'ODS CSV FILE = '''||&opFile||''';' || 'proc sql;' || 'select * from dictionary.tables where memname='''||&uDSName||''';' || 'select * from dictionary.columns where memname='''||&uDSName||''';' || 'run;' || 'ODS CSV CLOSE;'
;

call execute(&tempLine);

run;
--------------------------------------------------------------------------------------------------
The above program runs fine through the SAS application and I get the metadata extracted in the appropriate csv files. But if I try to run the same program through a windows .bat file I don't see any output(No csv files created). My .bat file contains

------------------------------------------------------------------------------------------------
set program_path="C:\DAG\SAS\Tests\mySASProgram.sas"
set log_path="C:\DAG\SAS\Tests\mySASProgram.log"


"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -SYSPARM incov -SYSIN %program_path% -log %log_path%
------------------------------------------------------------------------------------------------

Any ideas on what I'm missing in the .bat file?

Thanks & Regards,
Neelam
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What does your SAS Log reveal about the SAS code being executed? Recommend you generate as much output for your executed code - add the following:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN ;

Then review the SASLOG output and if the problem is not obvious, then re-post a reply to this thread and paste the relevant SAS log (where code is executed) for additional diagnosis.

Scott Barry
SBBWorks, Inc.

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 709 views
  • 0 likes
  • 2 in conversation