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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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