Sas 如何刷新文件视图
在Enterprise Guide 4.2中,除了从流程中删除文件然后重新打开文件外,是否还有其他方法可以刷新文件视图 我的Google fu没有提供答案(一种或另一种),我的SAS管理员说他不知道有什么办法(但如果我找到了,就告诉他) 如有明确的“否”(来自文件)或带有示例的“是”,将不胜感激Sas 如何刷新文件视图,sas,enterprise-guide,Sas,Enterprise Guide,在Enterprise Guide 4.2中,除了从流程中删除文件然后重新打开文件外,是否还有其他方法可以刷新文件视图 我的Google fu没有提供答案(一种或另一种),我的SAS管理员说他不知道有什么办法(但如果我找到了,就告诉他) 如有明确的“否”(来自文件)或带有示例的“是”,将不胜感激 我有一个日志文件,当我从命令行(在EG之外)运行SAS程序时,它会被更新。我在EG中编辑代码,我想查看日志文件以查看结果。目前,我必须从我的流程中删除日志文件,然后重新打开它以查看更新的日志。从您上次
我有一个日志文件,当我从命令行(在EG之外)运行SAS程序时,它会被更新。我在EG中编辑代码,我想查看日志文件以查看结果。目前,我必须从我的流程中删除日志文件,然后重新打开它以查看更新的日志。从您上次对问题的评论中,听起来您好像在服务器上运行非交互式SAS程序(从PuTTY会话),并与EG客户机一起查看日志文件,对吗?如果是这样,有更简单的方法来查看日志文件 当你提到PuTTY时,我假设你的服务器是UNIX。如果是这样,请使用带有
-f
选项的tail
命令。例如,如果您的SAS程序名为“myprog.SAS”,它将创建一个名为“myprog.log”的日志文件,请在UNIX提示符下尝试以下命令:
tail -f myprog.log
-f
选项意味着在将行写入日志时继续将输出写入终端窗口。当你看腻了(或看到SAS的“工作结束”消息)时,键入字母“q”退出
例如,您打算成为实际执行SAS程序的应用程序。从UNIX提示符运行东西超出了设计范围(并且您会丢失所有这些很酷的EG功能),并且会丢失在元数据环境中为您设置的任何站点功能
如果我完全不正确,请澄清您的问题。从您上次对问题的评论来看,听起来您好像在服务器上运行非交互式SAS程序(从PuTTY会话),并与您的EG客户端一起查看日志文件,对吗?如果是这样,有更简单的方法来查看日志文件 当你提到PuTTY时,我假设你的服务器是UNIX。如果是这样,请使用带有
-f
选项的tail
命令。例如,如果您的SAS程序名为“myprog.SAS”,它将创建一个名为“myprog.log”的日志文件,请在UNIX提示符下尝试以下命令:
tail -f myprog.log
-f
选项意味着在将行写入日志时继续将输出写入终端窗口。当你看腻了(或看到SAS的“工作结束”消息)时,键入字母“q”退出
例如,您打算成为实际执行SAS程序的应用程序。从UNIX提示符运行东西超出了设计范围(并且您会丢失所有这些很酷的EG功能),并且会丢失在元数据环境中为您设置的任何站点功能
如果我完全偏离了基准,请澄清您的问题。在SAS平台中使用SAS EG或SAS Studio时,如果计算节点托管在Linux机器上,我总是使用代码查看SAS创建的输出文件的内容;唯一的要求是您知道要浏览的文件的完整路径,并且您有权从中读取 简单的想法是使用通用数据步骤:
- 首先,我为测试创建一个文件。你已经有了!,所以用你的
/* create a test file */ data _null_; file '/folders/myshortcuts/test/file'; /* Note I'm using fullpath */ put "The begining, :)"; put "line 2 in my file is shy and likes to hide."; put "line 3, all good so far."; put "line 4 in my file is to remain private."; put "Finally the last line in my file!"; run;
- 然后,这里是读取其数据的代码
data _null_; /*-------- references which input file will be read setting variable 'theEnd'=1 when reaches end-of-file Note I'm using fullpath --------*/ infile '/folders/myshortcuts/test/file' end=theEnd; /*-------- reads one line at a time from input file storing it in variable _infile_ --------*/ input; /*-------- contents of file will be writen in the log, to keep it readable, mark where the contents of the file will follow --------*/ if _n_=1 then put "-----start file ----"; /*-------- filter out shy, private or unwanted data --------*/ if _n_ ne 4; /* continue only if row number is not 4 */ if indexw(_infile_,"shy") le 0; /* continue only if data does not contains 'shy' */ /*-------- write the data you want, complete line read in this case --------*/ put _N_= "->" _infile_; /*-------- mark where the data in the file has ended --------*/ if theEnd then put "-----end file ----"; run;
- 您的SAS日志如下所示:
NOTE: The infile '/folders/myshortcuts/test/file' is: Filename=/folders/myshortcuts/test/file, Owner Name=sasdemo,Group Name=sas, Access Permission=-rw-rw-r--, Last Modified=11Jan2017:22:42:56, File Size (bytes)=160 -----start file ---- _N_=1 ->The begining, :) _N_=3 ->line 3, all good so far. _N_=5 ->Finally the last line in my file! -----end file ---- NOTE: 5 records were read from the infile '/folders/myshortcuts/test/file'. The minimum record length was 16. The maximum record length was 43. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.03 seconds
- 首先,我为测试创建一个文件。你已经有了!,所以用你的
/* create a test file */ data _null_; file '/folders/myshortcuts/test/file'; /* Note I'm using fullpath */ put "The begining, :)"; put "line 2 in my file is shy and likes to hide."; put "line 3, all good so far."; put "line 4 in my file is to remain private."; put "Finally the last line in my file!"; run;
- 然后,这里是读取其数据的代码
data _null_; /*-------- references which input file will be read setting variable 'theEnd'=1 when reaches end-of-file Note I'm using fullpath --------*/ infile '/folders/myshortcuts/test/file' end=theEnd; /*-------- reads one line at a time from input file storing it in variable _infile_ --------*/ input; /*-------- contents of file will be writen in the log, to keep it readable, mark where the contents of the file will follow --------*/ if _n_=1 then put "-----start file ----"; /*-------- filter out shy, private or unwanted data --------*/ if _n_ ne 4; /* continue only if row number is not 4 */ if indexw(_infile_,"shy") le 0; /* continue only if data does not contains 'shy' */ /*-------- write the data you want, complete line read in this case --------*/ put _N_= "->" _infile_; /*-------- mark where the data in the file has ended --------*/ if theEnd then put "-----end file ----"; run;
- 您的SAS日志如下所示:
NOTE: The infile '/folders/myshortcuts/test/file' is: Filename=/folders/myshortcuts/test/file, Owner Name=sasdemo,Group Name=sas, Access Permission=-rw-rw-r--, Last Modified=11Jan2017:22:42:56, File Size (bytes)=160 -----start file ---- _N_=1 ->The begining, :) _N_=3 ->line 3, all good so far. _N_=5 ->Finally the last line in my file! -----end file ---- NOTE: 5 records were read from the infile '/folders/myshortcuts/test/file'. The minimum record length was 16. The maximum record length was 43. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.03 seconds