- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-29-2020 09:35 AM
(1182 views)
Hi I am Getting trailing "." (Period,dot) when i try to create a dataset using teradata passthrough.i want the variable as character.
Eg.
Prf_id(varchar)
626278.
726277.
627277.
726256.
62727.
Please help.
Thanks
Eg.
Prf_id(varchar)
626278.
726277.
627277.
726256.
62727.
Please help.
Thanks
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please post the whole code that created this dataset. Use the "little running man" to post code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here is the code-
proc sql;
connect to teradata as tera1 (user="xxxxxx" password="xxxxxxx" server="xxxxx"
tpt=yes fastexport=yes);
create table mytable as
select * from connection to tera1
(select age
,entityno
,cast(segid as varchar(50)) as fbu1
,cast(profgrp_id as varchar(30)) as trnsid
,cast(accno as integer)as accno
,cast(startdt as varchar(10)) as startdt
,cast(enddt as varchar(10)) as enddt
from mytable1 a
Mytabke2
where age > 15 );
disconnect from tera1;
quit;
proc sql;
connect to teradata as tera1 (user="xxxxxx" password="xxxxxxx" server="xxxxx"
tpt=yes fastexport=yes);
create table mytable as
select * from connection to tera1
(select age
,entityno
,cast(segid as varchar(50)) as fbu1
,cast(profgrp_id as varchar(30)) as trnsid
,cast(accno as integer)as accno
,cast(startdt as varchar(10)) as startdt
,cast(enddt as varchar(10)) as enddt
from mytable1 a
Mytabke2
where age > 15 );
disconnect from tera1;
quit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just a demo code.with changed names.sorry if i there is typo.but syntax is same
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Since the original values are in decimal format, you will need the double cast.
proc sql;
connect to teradata as tera1 (user="xxxxxx" password="xxxxxxx" server="xxxxx"
tpt=yes fastexport=yes);
create table mytable as
select * from connection to tera1
(select age
,entityno
,cast(cast(segid as format 'Z(I)') as varchar(50)) as fbu1
,cast(cast(profgrp_id as format 'Z(I)') as varchar(30)) as trnsid
,cast(accno as integer)as accno
,cast(cast(startdt as format 'Z(I)') as varchar(10)) as startdt
,cast(cast(enddt as format 'Z(I)') as varchar(10)) as enddt
from mytable1 a
Mytabke2
where age > 15 );
disconnect from tera1;
quit;
Let me know if this helps.