Page 1 of 2

Special character !! ... ascii value "20" ?

Posted: Fri Mar 23, 2007 2:26 pm
by ady
HI,

I am creating a fixed width file as a final target to my job. DS fills the empty space with blank values which are not spaces. This file when we try to load to SAP those blanks show as ###.

I have tried viewing the file in HEX EDITOR and found that "20" is filling in the spaces( THE VALUE IN RED BELOW). How can I prevent this.

DEC HEX CHARACTER DEC HEX CHARACTER
------------------------------------------------
0 00 ctl@ NUL | 64 40 @
1 01 ctlA SOH | 65 41 A
2 02 ctlB STX | 66 42 B
3 03 ctlC ETX | 67 43 C
4 04 ctlD EOT | 68 44 D
5 05 ctlE ENQ | 69 45 E
6 06 ctlF ACK | 70 46 F
7 07 ctlG BELL | 71 47 G
8 08 ctlH BS | 72 48 H
9 09 ctlI HT | 73 49 I
10 0A ctlJ LF | 74 4A J
11 0B ctlK VT | 75 4B K
12 0C ctlL FF | 76 4C L
13 0D ctlM CR | 77 4D M
14 0E ctlN SO | 78 4E N
15 0F ctlO SI | 79 4F O
16 10 ctlP DLE | 80 50 P
17 11 ctlQ DC1 | 81 51 Q
18 12 ctlR DC2 | 82 52 R
19 13 ctlS DC3 | 83 53 S
20 14 ctlT DC4 | 84 54 T
21 15 ctlU NAK | 85 55 U
22 16 ctlV SYN | 86 56 V
23 17 ctlW ETB | 87 57 W
24 18 ctlX CAN | 88 58 X


I am using APT_STRING_PADCHAR , but it dosent seem to work ...

Please help

Posted: Fri Mar 23, 2007 2:28 pm
by DSguru2B
Is this server job or px job?

Posted: Fri Mar 23, 2007 2:29 pm
by ady
PX JOB

But I am using a server transformer in the job.... We dont have the parallel compiler :(

Posted: Fri Mar 23, 2007 2:31 pm
by ady
0506110000 0000905413TN200605120620000000 0000905413TN200605140356380000
0000905413TN200605150568250000 0000905413TN200605210306880000 0000915113
ZP200608130546660000 0000915113ZP200608140291640000 0000915113ZP2006081806
04450000 0000915113ZP200608210647340000 0000905413TN200605120241960000
0000905413TN200605140136140000 0000905413TN200605150607890000 0000905413TN
200605210322420000 0000905413TN200605120291000000 0000905413TN200605150245
820000 0000905413TN200605160585850000 0000905413TN200605250550390000 00
00915213ZQ200608140487070000 0000915213ZQ200608140217140000 0000915313ZR2006
08110620000000 0000915313ZR200608110306560000 0000905413TN2006051201325200
00 0000905413TN200605150439370000 0000905413TN200605160447390000 000090
5413TN200605110199660000 0000905413TN200605120217620000 0000905413TN200605


That is how the data looks , but those blank spaces are filled by that character

Posted: Fri Mar 23, 2007 4:06 pm
by us1aslam1us
Hi adi, Can you explain your problem clearly?

Posted: Fri Mar 23, 2007 5:54 pm
by ray.wurlod
It's correct. 20 is the space character. Bytes are reported in hexadecimal.

Posted: Sat Mar 24, 2007 2:09 pm
by chulett
As noted, if it is truly an ASCII hex 20 - that's a space. You've highlighted a decimal 20 in the list above, something else entirely. Which is it?

And where exactly do these characters show as '# # #'? :?

Posted: Sat Mar 24, 2007 4:10 pm
by ray.wurlod
Using a HEX EDITOR :roll:

Posted: Sat Mar 24, 2007 5:23 pm
by chulett
And we all know that a "hex editor" can only display hex values. :roll:

Posted: Sat Mar 24, 2007 9:30 pm
by DSguru2B
The hashes (#) show up in SAP right, so I guess you need a SAP expert to tell you what needs to be done. Or trim the fields before loading.

Posted: Sat Mar 24, 2007 10:11 pm
by ray.wurlod
The hashes might be being put in by DataStage, if that's the pad character setting. If the table definitions were imported from sequential files, that is a significant possibility.

Posted: Sun Mar 25, 2007 7:49 am
by chulett
Since that's the default padding character, I heartily agree. Now we just need a definitive answer on what the character really is.

The SAP 'issue' is the only reason I wanted to clarify things.

Posted: Mon Mar 26, 2007 9:35 am
by ady
Thanks for the replies guys ... sorry i'm late to catch up,

The "space characters" which are padding the data show up as "#" in SAP BW environment.

20 14 ctlT DC4 | 84 54 T is the value padding the data, Its a space but shows up as "#" in SAP. When i try to view the file with the command

od -tc $Filename

The padding spaces show up as null values , here's a sample of how the data looks:

Code: Select all

\n   "   2   0   0   6   1   2   1   8   "   "   0   2   5   7
 7   0  \0  \0  \0  \0   "   "   0   2   5   7   7   0  \0  \0
\0  \0   "   "   C   0   3   0   5   6   0   0   0   0   0
    \0  \0  \0  \0  \0   "   "              \0   "   "   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   "
 "   5   9   7   "   "          \0   "   "   0   0   9   3   0
 3   2   0   0   4   "   "   2   0   0   7   0   3   2   6   "
 "   1   1   1   7   2   3   "   "   0   0   0   0   5   8   0
 3   "   "   0   0   0   0   9   2   7   8   "   "   1   4   M
 Y  \0  \0  \0  \0   "   "   2   0   3   9   9   "   "
                         "   "       "   "      \0  \0  \0   "
 "       "  \n   "   2   0   0   6   1   2   1   8   "   "   0
 2   3   2   3   8  \0  \0  \0  \0   "   "   0   2   3   2   3
 8  \0  \0  \0  \0   "   "   C   0   3   0   5   6   0   0   0
 0   0          \0  \0  \0  \0  \0   "   "              \0   "
[/color]



If the character padding the data is a space the data should be like :

Code: Select all

[color=blue]0   0   0   0   0   .   "   ,   "   C   0   3   0   5   6   0
0   0   0   0           "   ,   "   2   0   3   9   9   "   ,
"   5   9   7           "  \n   "       0   0   0   0   5   8
0   3   .   "   ,   "       0   0   0   0   9   2   7   8   .
"   ,   "   1   4   M   Y   "   ,   "   0   2   7   0   3   8
"   ,   "   0   0   9   3   0   3   1   5   1   3   "   ,   "
2   0   0   6   -   1   2   -   1   8   "   ,   "   5   1   2
8   0   "   ,   "                                           "
,   "               "   ,   "       "   ,   "           "   ,
"       0   0   0   0   0   0   0   0   0   0   0   0   0   0
0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
0   0   0   0   0   0   0   0   .   "   ,   "   C   0   3   0
5   6   0   0   0   0   0           "   ,   "   2   0   3   9
9   "   ,   "   5   9   7           "  \n   "       0   0   0
0   5   8   0   3   .   "   ,   "       0   0   0   0   9   2[/color]
Hope I am more clear this time

Posted: Mon Mar 26, 2007 9:44 am
by ady
The job design is like this:


SEQUENTIAL FILE - BASIC TRANSFORMER - SEQUENTIAL FILE

I am Trimming, changing the datatypes from varchar to char, and forcing 2 decimal(20) values to char(17) using Right(Trim(IN.COL,".","A"),17)


Thats it ... there nothing more to the job. you can see the data posted above as viewed from od -tc, the clean data is the input and the one with nulls is the output for this job.

Please let me know if I am doin anything wrong. Thanks

Posted: Mon Mar 26, 2007 5:42 pm
by ray.wurlod
Go to the Format tab on the downstream sequential file stage. Tell us what the Pad Character field contains.