导入xlsx时如何指定informat [英] How to specify informat when importing xlsx

查看:39
本文介绍了导入xlsx时如何指定informat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在导入 excel xlsx 文件.它包含一些 date 值.我想指定 informat

I am importing excel xlsx file. it contains some date values. i want to specify informat

proc import out=test 
/* i tried input and informat but it did not work */
datafile="C:\Users\ALCopy.xlsx" 
dbms=excel replace;
range="Test1$"; 
getnames=no ;
mixed=no;
scantext=yes;
usedate=no;
scantime=no; 
run;

我尝试了 userdate=yes 但这并不适用于所有日期列.其中许多被视为字符串列.如何为每一列单独设置 informat ?

I tried userdate=yes but this did not work for all date columns . Many of then were treated as string columns . How can I set up informat for each column individually ?

我稍后尝试使用 informat 语句更改它,但它不起作用

i tried changing it later with informat statement but it did not work

推荐答案

您可以使用 DBSASTYPE 选项来指定如何引入列.

You can use the DBSASTYPE option to specify how a column is brought in.

DBDSOPTS="DBSASTYPE=(datevar='DATE')";

这并不总是有效,这取决于为什么它不会自动进入正确的状态,但有时确实如此.

This doesn't always work depending on why it is not automatically coming in right, but it sometimes does.

这篇关于导入xlsx时如何指定informat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆