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

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

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

Post 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
Last edited by ady on Fri Mar 23, 2007 2:53 pm, edited 2 times in total.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Is this server job or px job?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

PX JOB

But I am using a server transformer in the job.... We dont have the parallel compiler :(
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post 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
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hi adi, Can you explain your problem clearly?
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's correct. 20 is the space character. Bytes are reported in hexadecimal.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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 '# # #'? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Using a HEX EDITOR :roll:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And we all know that a "hex editor" can only display hex values. :roll:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post 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
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Go to the Format tab on the downstream sequential file stage. Tell us what the Pad Character field contains.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply