SAS表观符号参考PWD未解决

Bur*_*ras 0 sas

我有SAS代码从外部.txt文件读取我的密码并与之建立连接odbc .当我在SAS中运行以下代码时,它工作正常

filename pw "C:/xxxx"; 

data _NULL_ ;
  infile pw  ; 
  input pw : $50. ;
  call symputx('pwd',pwd);
run;

libname xxx odbc user=myUser password=&pwd. dsn=myDsn schema=mySchema;

proc sql;  
  connect to xxx(dsn=myDsn user=myUser password=&pwd.);
Run Code Online (Sandbox Code Playgroud)

但是,当我创建批处理文件以从Windows任务计划程序运行它或从SAS Enterprise Guide运行它时,我得到了 Apparent symbolic reference PWD not resolved

为什么会这样?如何处理这个问题?

Joe*_*Joe 5

因为您call symputx没有正确定义它,至少基于您粘贴的代码.

data _NULL_ ;
  infile pw  ; 
  input pw : $50. ;
  call symputx('pwd',pw);
run;
Run Code Online (Sandbox Code Playgroud)

这将是正确的语法(或更改要读取的输入语句pwd).看看你的datastep的日志,它应该有一个警告pwd was uninitialized.

如果您正确粘贴了代码,我仍然会查看您的数据步骤的日志,并查看是否有任何行已处理.mjsqu可能是正确的,因为您可能无法看到目录(如果它在服务器上并且您没有访问服务器可见目录),或者由于您处于不同的环境中而可能存在某些其他问题.