问题标签 [informat]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
5 回答
7820 浏览

datetime - sas 信息日期时间

谁能建议适当的 SAS 信息以读取日期时间(dd/mm/yyyy hh:mm)???

例如

0 投票
3 回答
5570 浏览

datetime - SAS 信息日期时间毫秒

SAS 可以存储和使用包含小于 1/10 秒的分数的日期时间吗?

例如:

0 投票
3 回答
12648 浏览

types - SAS:格式/信息/类型。他们的区别

关于格式和信息的另一个问题:

格式用于输出(用于显示我和表中的其他用户数据),所以,我不关心它,如果我想以编程方式从表中读取数据,是吗?

但什么是信息?

我有这样的代码数据步骤:

此代码是否有效?每个语句中的所有这些变量是什么类型?

我是对的,var 的信息和类型是相似的吗?

此外,日期(__ToDate, __FromDate)是否具有数字类型?(他们的缺失值是点.,而不是引号"")?

谢谢!

0 投票
1 回答
266 浏览

date - 在 SAS 中无法正确读取日期和时间字符串

我有以下示例数据要读入 SAS

但是,有一个奇怪的问题困扰着我。这是我的第一次尝试。

结果显示

这意味着日期和时间读取不正确。我现在的一个解决方法是首先将所有内容读取为字符串,然后分别将其转换为日期和时间。

这样,一切都得到了正确的格式。

基本上,这两种方法使用相同的信息。我想知道为什么第一种方法不起作用。感谢任何形式的帮助。非常感谢你。

0 投票
1 回答
216 浏览

sas - 为什么 informat 在 SAS 中不起作用

尝试了各种格式的日期,但输出不反映任何日期。可能是什么问题?

0 投票
1 回答
3156 浏览

sas - SAS 9.2 informat Z

I have a code that completes without errors in SAS EG 4.3 but encounters an error when run in LSF Flow Manager.

ERROR: The informat Z was not found or could not be loaded.

What could be the problem?

Thanks!


0 投票
2 回答
703 浏览

sas - 如何将信息(逗号分隔值)导入 sas

我在选项卡文件中有一个带逗号的数据,并且我已经将其导入到 sas 中,作为带有逗号值的 char 数据类型。像 23,1 53,2

我现在想用其中一个将它们转换为数字。或逗号我该怎么做?如果我使用

我得到缺失值。,!

0 投票
1 回答
5101 浏览

time - 将数据读入 SAS 时格式化 HH:MM 列

我是一名R用户和SAS初学者,试图将 csv 文件读入SAS. 我面临的问题是一个名为“TIME”的列,其中包含格式为“hh:mm”的时间数据,例如“12:23 PM”。在R其中很简单as.POSIXct(df$TIME, format = "%I:%M %p"),我的时间会立即转换为时间值(可以删除时区和今天的日期)。

这就是我尝试在 SAS 中实现它的方式:

time informat不存在?我在 SAS 网站上阅读了此文档:http: //support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201204.htm,我认为我做得对。我是整个 SAS 领域的新手,如果我在提问和粘贴示例数据等方面没有遵循惯例,我深表歉意。

0 投票
1 回答
131 浏览

date - 无法在 SAS 中将字符更改为日期

我将 5 个 excel 文件导入 SAS,有一些日期最初格式化为 1989 年 8 月 3 日,然后格式化为 03Aug1989 (DATE9.),这是我真正想要的。但是,在 1 个文件中,日期未能转换为 DATE9。当我阅读日志时,它被读取为 $CHAR10。我尝试了几种方法将其重新格式化为 DATE9 但失败了。

  1. 我试图将所有信息/格式/输入更改为 DATE9。而不是 $CHAR10 但失败了,结果都是空的 (.)
  2. 我试过 DateNew=input (Date,DATE9.); 但它也没有用。

任何意见?

谢谢!

0 投票
2 回答
8758 浏览

datetime - What is the SAS format and informat for "mm/dd/yyyy hh:mm:ss"?

The Question

Please is there a built-in SAS format and informat for datetime in mm/dd/yyyy hh:mm:ss? For example:

06/25/2015 03:02:01 (June 25th 2015, 3 o'clock 2 minute 1 second).

The Background

I am trying to parse a CSV flatfile to a SAS dataset in which a datetime column is currently presented in mm/dd/yyyy hh:mi:ss format. I usually would just read it as a string, and then use the substr() function to pick out the date and time parts (as strings), use informat to resolve the SAS date and time (as numbers), and then combine them together to form a SAS datetime (as numbers). I am guessing there could be a cleaner way to do this and therefore am curious if there is already a built-in SAS datetime for mm/dd/yyyy hh:mm:ss which will enable me to read this in one-parse, like this:

I have been doing lots of Google searches on this and no luck. Would be very grateful for this!

EDIT / Update (on additional research efforts and findings)

Following the generous forum responses I have performed a comparison between the bespoke (home-made) format mdyhms and the SAS built-in format mdyampm.

The success factors are:

  • Format case: be able to display 1748351045 as "06/25/2015 03:02:01"
  • Informat case: be able to convert "06/25/2015 03:02:01" to 1748351045

The bespoke format mdyhms looks like this:

The comparison exercise below reveals some interesting observations:

  • Format case: the bespoke format mdyhms is the winner.
  • Informat case: the built-in format mdyampm is the winner.

Now the comparison exercise...

Format Case

Informat Case

Next step:

Are there any built-in (and/or bespoke) formats that will enable BOTH format and informat as per following success factors:

  • Format case: be able to display 1748351045 as "06/25/2015 03:02:01"
  • Informat case: be able to convert "06/25/2015 03:02:01" to 1748351045

(the bespoke mdyhms and built-in mdyampm seem to be able to achieve one of the two, but not both). Or have I missed anything?