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
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.
Just DATE format.
kindly give me inputs.
Teradata is most likely expecting a datetime variable not a date.
Thanks for your help. I really appreciate it.
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
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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.