SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Hard time with SAS to Teradata Date Format - Upload

Reply
Contributor
Posts: 40

Hard time with SAS to Teradata Date Format - Upload

Hi,

I'm having hard time with date format of SAS to Teradata data upload.

My is as below.

here X is my Teradata library. Y is my SAS library

proc sql;

create table X.pace  as

select division_name, region_name, lob, bus_res,activity, fme , date, qty  from Y.pace;

run;

Date format is not as expected. how exactly should I select the query to pass the correct date format.

Thanks,

Naresh

Super User
Posts: 19,772

Re: Hard time with SAS to Teradata Date Format - Upload

Posted in reply to NareshAbburi

What do you expect a date to look like in Teradata?

How does it look like in SAS?

If you go to the MORE LIKE THIS section on the right hand side of the page on your question you'll see several answers to this common question.

Contributor
Posts: 40

Re: Hard time with SAS to Teradata Date Format - Upload

Just DATE format.

kindly give me inputs.

Super User
Posts: 19,772

Re: Hard time with SAS to Teradata Date Format - Upload

Posted in reply to NareshAbburi

Teradata is most likely expecting a datetime variable not a date.

Contributor
Posts: 40

Re: Hard time with SAS to Teradata Date Format - Upload

Thanks for your help. I really appreciate it.

PROC Star
Posts: 1,167

Re: Hard time with SAS to Teradata Date Format - Upload

Posted in reply to NareshAbburi

In your Y.pace table, does the "date" field have a date format attached? Sometimes SAS uses that as an indicator to create a different column format in the target database.

You can use this code to associate a date format with the variable:

proc datasets library=Y nolist;

modify pace;

format date date.;

quit;

If "date" is a datetime variable, use the datetime. format instead of date.

Tom

Super User
Super User
Posts: 7,039

Re: Hard time with SAS to Teradata Date Format - Upload

Posted in reply to NareshAbburi

Should work fine.  How is it different?

What  did the SAS log show?  Did you turn on displaying the generated Teradata SQL code?

libname X teradata server=&server username=&username password=&password

connection=global mode=teradata database=&userdb

;

data pace ;

  length  division_name region_name  lob  bus_res activity  fme $20 ;

  length  date qty  8;

  format date date9. ;

  informat date date9. ;

  input division_name -- qty ;

cards;

division_name region_name lob bus_res activity fme 09AUG2015 100

;;;;

data x.pace;

  set pace;

run;

data _null_;

set x.pace ;

put (_all_) (=/);

run;

division_name=division_name

region_name=region_name

lob=lob

bus_res=bus_res

activity=activity

fme=fme

date=09AUG2015

qty=100

Ask a Question
Discussion stats
  • 6 replies
  • 470 views
  • 6 likes
  • 4 in conversation