热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

数学思想方法sasMEMO(17)

SAS日期及时间格式data_null_;inputmydateYYMMDD10.;putmydateYYMMDDB10.;putmydateYYMMDDC10.;putmydat

SAS日期及时间格式

data  _null_;
input mydate YYMMDD10.;
put mydate YYMMDDB10.;
put mydate YYMMDDC10.;
put mydate YYMMDDD10.;
put mydate YYMMDDN8.;
put mydate YYMMDDP10.;
put mydate YYMMDDS10.;
cards;
2014-05-18
;
run;

本博客全部内容是原创,假设转载请注明来源

http://blog.csdn.net/myhaspl/


2014 05 18
2014:05:18
2014-05-18
20140518
2014.05.18
2014/05/18
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间          0.03 秒
      CPU 时间          0.01 秒

短日期格式 

data  _null_;
input mydate YYMMDD10.;
put mydate YYMMDDB8.;
put mydate YYMMDDC8.;
put mydate YYMMDDD8.;
put mydate YYMMDDN7.;
put mydate YYMMDDP8.;
put mydate YYMMDDS8.;
cards;
2014-05-18
;
run;

14 05 18
14:05:18
14-05-18
 140518
14.05.18
14/05/18
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间          0.00 秒
      CPU 时间          0.00 秒

Writes SAS date values in the form <yy>yymmdd or <yy>yy-mm-dd, where the x in the format name is a character that represents the special character that separates the year, month, and day. The special character can be a hyphen (–), period (.), blank character, slash (/), colon (:), or no separator; the year can be either 2 or 4 digits.

Syntax 




YYMMDDxw. 






Arguments 




x




identifies a separator or specifies that no separator appear between the year, the month, and the day. Here are the valid values: 




B




separates with a blank




C




separates with a colon 




D




separates with a hyphen 




N




indicates no separator




P




separates with a period 




S




separates with a slash.




w




specifies the width of the output field. 






Default


8






Range


2–10






Interactions


When w has a value of from 2 to 5, the date appears with as much of the year and the month. When w is 7, the date appears as a two-digit year without separators. 






When x has a value of N, the width range is 2–8. 






Details 




The YYMMDDxw. format writes SAS date values in the form yymmdd or yyXmmXdd. Here is an explanation of the syntax: 




yy




is a two-digit or four-digit integer that represents the year. 




X




is a specified separator.




mm




is an integer that represents the month. 




dd




is an integer that represents the day of the month. 




Comparisons 







The YYMMDDw.d format is similar to the YYMMDDxw.d format, but YYMMDDxw.d format contains a separator between the year and month, such as a colon, slash, or period. 






Example 




The following examples use the input value of 18922, which is the SAS date value that corresponds to October 22, 2011. 










Statements 




Results 








 


----&#43;----1----&#43; 






a&#61;put(18922,yymmddc5.); 


11:10 






a&#61;put(18922,yymmddd8.); 


11-10-22 






a&#61;put(18922,yymmddn8.); 


20111022 






a&#61;put(18922,yymmddp10.); 


2011.10.22 



版权声明&#xff1a;本文博主原创文章&#xff0c;博客&#xff0c;未经同意不得转载。




推荐阅读
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • C++字符字符串处理及字符集编码方案
    本文介绍了C++中字符字符串处理的问题,并详细解释了字符集编码方案,包括UNICODE、Windows apps采用的UTF-16编码、ASCII、SBCS和DBCS编码方案。同时说明了ANSI C标准和Windows中的字符/字符串数据类型实现。文章还提到了在编译时需要定义UNICODE宏以支持unicode编码,否则将使用windows code page编译。最后,给出了相关的头文件和数据类型定义。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 展开全部下面的代码是创建一个立方体Thisexamplescreatesanddisplaysasimplebox.#Thefirstlineloadstheinit_disp ... [详细]
  • Tomcat/Jetty为何选择扩展线程池而不是使用JDK原生线程池?
    本文探讨了Tomcat和Jetty选择扩展线程池而不是使用JDK原生线程池的原因。通过比较IO密集型任务和CPU密集型任务的特点,解释了为何Tomcat和Jetty需要扩展线程池来提高并发度和任务处理速度。同时,介绍了JDK原生线程池的工作流程。 ... [详细]
  • 本文介绍了南邮ctf-web的writeup,包括签到题和md5 collision。在CTF比赛和渗透测试中,可以通过查看源代码、代码注释、页面隐藏元素、超链接和HTTP响应头部来寻找flag或提示信息。利用PHP弱类型,可以发现md5('QNKCDZO')='0e830400451993494058024219903391'和md5('240610708')='0e462097431906509019562988736854'。 ... [详细]
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • 怀疑是每次都在新建文件,具体代码如下 ... [详细]
  • 本文讨论了如何在codeigniter中识别来自angularjs的请求,并提供了两种方法的代码示例。作者尝试了$this->input->is_ajax_request()和自定义函数is_ajax(),但都没有成功。最后,作者展示了一个ajax请求的示例代码。 ... [详细]
  • Python爬虫中使用正则表达式的方法和注意事项
    本文介绍了在Python爬虫中使用正则表达式的方法和注意事项。首先解释了爬虫的四个主要步骤,并强调了正则表达式在数据处理中的重要性。然后详细介绍了正则表达式的概念和用法,包括检索、替换和过滤文本的功能。同时提到了re模块是Python内置的用于处理正则表达式的模块,并给出了使用正则表达式时需要注意的特殊字符转义和原始字符串的用法。通过本文的学习,读者可以掌握在Python爬虫中使用正则表达式的技巧和方法。 ... [详细]
author-avatar
itlzk
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有