我来自 SQL Server 背景,是使用 SAS 的新手。要将平面文件自动导入 SQL Server,我会使用 SQL Server Integration Services 包并通过 Management Studio 安排一个作业来获取和导入文件。
我如何在 SAS 中做同样的事情。我所做的研究表明,SAS Management Console 有一个调度插件,但我如何创建一个执行导入的作业?我在企业指南中这样做吗?
我来自 SQL Server 背景,是使用 SAS 的新手。要将平面文件自动导入 SQL Server,我会使用 SQL Server Integration Services 包并通过 Management Studio 安排一个作业来获取和导入文件。
我如何在 SAS 中做同样的事情。我所做的研究表明,SAS Management Console 有一个调度插件,但我如何创建一个执行导入的作业?我在企业指南中这样做吗?
The job that does the import would presumably be a short SAS program that reads the file in. You would indeed manage that in EG, if that's what you're using to manage the general process flow (for servers I imagine it would be). You can either use an import wizard, write a PROC IMPORT statement, like:
proc import file="whatever.csv" out=dsetname dbms=csv replace;
run;
if it is a CSV, or write a data step if it's not a delimited file (or, even if it is):
data dsetname;
infile "whatever.txt";
input
@1 varname $8.
@10 varname2 $5.
@16 varname3 4.
;
run;
The latter is the most flexible, but does require knowing the data completely; a PROC IMPORT can read the header row from a delimited file and make reasonable guesses as to the width of fields.