Control characters(Junk chars) in flat files from SQL server
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 8
- Joined: Tue Jan 12, 2010 10:34 pm
- Location: Chennai
Control characters(Junk chars) in flat files from SQL server
Hi,
I just extract data from a SQL server table (MS SQL) and write it in a flat file.
My job design is
ODBC Conn ---> CPY ---> SeqFile
I have 50 columns in it. after successful run, I get some control characters in the file like ^C or ^R. Be it Fixed width or Delimited, the file is not getting created with given no. of columns or in given length. No clue what could be the issue.
Please help it out.
Regards,
Sethuraman.
I just extract data from a SQL server table (MS SQL) and write it in a flat file.
My job design is
ODBC Conn ---> CPY ---> SeqFile
I have 50 columns in it. after successful run, I get some control characters in the file like ^C or ^R. Be it Fixed width or Delimited, the file is not getting created with given no. of columns or in given length. No clue what could be the issue.
Please help it out.
Regards,
Sethuraman.
-
- Participant
- Posts: 8
- Joined: Tue Jan 12, 2010 10:34 pm
- Location: Chennai
What you are getting if you use
The control chars are at the end of the line or some where else?
How you have configured the Sequential file stage?
Whats the delimter you have specified?
Code: Select all
cat filename
How you have configured the Sequential file stage?
Whats the delimter you have specified?
pandeeswaran
-
- Participant
- Posts: 8
- Joined: Tue Jan 12, 2010 10:34 pm
- Location: Chennai
if i use cat <file name> then i find no control characters. but if i open it in vi <file name> mode then it appears in front of few fields. I create file in Fixedwith mode. also i have tried creating comma seperated delimited file. nothing returns the exact output.
Thanks & Regards,
Sethuraman Rajendran,
SE - ISDC,
Renault-Nissan Technology and Business Centre India Private Limited,
Chennai – 603002,
Sethuraman.Rajendran@rntbci.com,
+91-9994304880 | + 91-44-67482128.
Sethuraman Rajendran,
SE - ISDC,
Renault-Nissan Technology and Business Centre India Private Limited,
Chennai – 603002,
Sethuraman.Rajendran@rntbci.com,
+91-9994304880 | + 91-44-67482128.
-
- Participant
- Posts: 8
- Joined: Tue Jan 12, 2010 10:34 pm
- Location: Chennai
pandeesh wrote:What you are getting if you useThe control chars are at the end of the line or some where else?Code: Select all
cat filename
How you have configured the Sequential file stage?
Whats the delimter you have specified?
if i use cat <file name> then i find no control characters. but if i open it in vi <file name> mode then it appears in front of few fields. I create file in Fixedwith mode. also i have tried creating comma seperated delimited file. nothing returns the exact output.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 8
- Joined: Tue Jan 12, 2010 10:34 pm
- Location: Chennai
priyadarshikunal wrote:what is the value of APT_STRING_PADCHAR environment variable and what is the data type of the field where you see the junk characters?
Value for the param APT_STRING_PADCHAR = 0x20.
I get the junk characters for all kind of datatypes like varchar, char, smallint.
Thanks & Regards,
Sethuraman Rajendran,
SE - ISDC,
Renault-Nissan Technology and Business Centre India Private Limited,
Chennai – 603002,
Sethuraman.Rajendran@rntbci.com,
+91-9994304880 | + 91-44-67482128.
Sethuraman Rajendran,
SE - ISDC,
Renault-Nissan Technology and Business Centre India Private Limited,
Chennai – 603002,
Sethuraman.Rajendran@rntbci.com,
+91-9994304880 | + 91-44-67482128.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
In anycase the smallint field should not have control characters, check the format options in seq file stage and check your extraction query as well if any kind of concatanation or padding is used.
BTW, which SQL Server version we are talking about here?
BTW, which SQL Server version we are talking about here?
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.