0

I am new using sas data Integartion Studio 4.9005. i am using database oracle 18.

the scenario is i move from table_A with data type varchar(100) to table_B with date data type.

the format from table_A is YYYY/MM/DD enter image description here

but the result is give me random number (01-01-1960) it doesn't make sense.

enter image description here

for code to convert is "INPUT( TANGGAL_LAHIR ,yymmdd10.)"

enter image description here

Is there i am missing ? Thank you very much.

yan
  • 37
  • 4
  • Are you sure the target field is DATE and not DATETIME. Any reasonable DATE value (number of days) would be early in the morning of 01JAN1960 if treated as a DATETIME value (number of seconds). – Tom Aug 26 '21 at 16:13
  • yes, i am sure the destination table ( target field ) have data type DATE – yan Aug 26 '21 at 16:16
  • 1
    But is it an ORACLE table? I don't think ORACLE actually has DATE type. Just DATETIME types that only display the DATE part. At least that is what I have seen happening to me in the past. What happens if you query the result and display it with a DATETIME format? Does it include a time of day? – Tom Aug 26 '21 at 16:19
  • Try using ANYDTDTM10. as the INFORMAT in your conversion. That will convert YYYY/MM/DD strings into number of seconds instead of number of days. – Tom Aug 26 '21 at 16:23
  • 1
    Also watch out for leading spaces in your source VARCHAR field. A lot of SAS displays will not show the leading spaces, but the INPUT() function will not ignore them. Try `INPUT(left(TANGGAL_LAHIR) ,yymmdd10.)` – Tom Aug 26 '21 at 16:26
  • 2
    @user3698988 You cut off the very right-most part of the important bit on the picture. Is that a "T" after "DATE" on TANGAL_LAHIR? Get a better part of that picture. There are two possibilities here, both of which suggest you have some information wrong; this is the most likely. – Joe Aug 27 '21 at 15:31
  • Add a User_Written_Code step (the last one in the Data group) add the code `proc contents data=STG_TD_KJP; proc contents data=TD_KJP; run;` share us the result. – Dirk Horsten Aug 30 '21 at 08:36

0 Answers0