LoginSignup
2
2

More than 5 years have passed since last update.

SAS日付

Posted at

SAS日付

yymmdd10 の機能

以下のようにゼロ埋めの形式が異なる日付を渡しても、宜しくやってくれる。

date_test1.sas
DATA _NULL_;
    test_date1_chr = '2017/7/1';
    test_date2_chr = '2017/07/01';
    test_date3_chr = '2017/7/01';
    test_date4_chr = '2017/07/1';

    test_date1 = input(test_date1_chr, yymmdd10.);
    test_date2 = input(test_date2_chr, yymmdd10.);
    test_date3 = input(test_date3_chr, yymmdd10.);
    test_date4 = input(test_date4_chr, yymmdd10.);

    format test_date1 yymmddn.; 
    format test_date2 yymmddn.; 
    format test_date3 yymmddn.; 
    format test_date4 yymmddn.; 

    put test_date1 ;
    put test_date2 ;
    put test_date3 ;
    put test_date4 ;

    RUN ;

/*出力
> 20170701
> 20170701
> 20170701
> 20170701
*/
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2