Non-ascii character problem
Moderators: chulett, rschirm, roy
Non-ascii character problem
I have to read a file which when I do:
od -xc
gives the characters as follows:
1 2 3 4 272 5 6 7 272 \r \n
272 is the field delimiter. How do I tell Datastage to ignore this character?
What I thought:
1)Read the columns as 1 more, for example, the first column above as char(5) and use a Left function downstream.
2)On the sequential fle stage, use the Filter option and use a Unix command. I don't know how to do this. Help appreciated.
Any other ideas?
od -xc
gives the characters as follows:
1 2 3 4 272 5 6 7 272 \r \n
272 is the field delimiter. How do I tell Datastage to ignore this character?
What I thought:
1)Read the columns as 1 more, for example, the first column above as char(5) and use a Left function downstream.
2)On the sequential fle stage, use the Filter option and use a Unix command. I don't know how to do this. Help appreciated.
Any other ideas?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
When I enter &h0110 in the Other Delimiter box, I get the error message:
Error: invalid character specification '&0h110'. You can enter any single character, or you can enter the ASCII code for a character either as a decimal number, or as atwo hexadecimal digits prefixed by &H. To specify no quote character, use 000 or &H00.
Error: invalid character specification '&0h110'. You can enter any single character, or you can enter the ASCII code for a character either as a decimal number, or as atwo hexadecimal digits prefixed by &H. To specify no quote character, use 000 or &H00.
-
- Participant
- Posts: 527
- Joined: Thu Apr 19, 2007 1:25 am
- Location: Melbourne
Your '0' and 'h' are swapped around.abc123 wrote:When I enter &h0110 in the Other Delimiter box, I get the error message:
Error: invalid character specification '&0h110'. You can enter any single character, or you can enter the ASCII code for a character either as a decimal number, or as atwo hexadecimal digits prefixed by &H. To specify no quote character, use 000 or &H00.
Use Hex value for delimiter
The file dump od -xc shows the delimiter in octal format. The value 272 translates to Hex BA or Decimal 186.
Specifying this delimiter in a Server sequential stage is obvious; you just enter the decimal 186 or &hBA in the delimiter field. This is readily available in the Help.
It is also possible to do this in parallel sequential file stages properties. To do this, go to the format->Field Defaults->Delimiter and enter a backslash followed by a 'x', then the Hex value. In this case it would be "\xBA". NOTE: I did this with "Delimiter" not "Delimiter String".
I did not find this in the Help. I found it by trial-and-error.
Specifying this delimiter in a Server sequential stage is obvious; you just enter the decimal 186 or &hBA in the delimiter field. This is readily available in the Help.
It is also possible to do this in parallel sequential file stages properties. To do this, go to the format->Field Defaults->Delimiter and enter a backslash followed by a 'x', then the Hex value. In this case it would be "\xBA". NOTE: I did this with "Delimiter" not "Delimiter String".
I did not find this in the Help. I found it by trial-and-error.
-
- Participant
- Posts: 5
- Joined: Thu Dec 29, 2005 1:33 am