Page 1 of 1

Mainframe low values

Posted: Thu Nov 18, 2010 12:39 pm
by hsahay
I have a text file in which we have some special/junk characters. the special charater is something like box whose ascii value is 255. When i checked, i came to know that the file is from mainframe and during coversion they have some mainframe low values left as is.

Now my problem is i want convert them to blanks.

I am not able to do that. i have searched the db and tried all the options told but they are not working.

I request you to help me in this regard. Thanks in advance

Posted: Thu Nov 18, 2010 2:08 pm
by chulett
Did you try convert?

Code: Select all

Convert(CHAR(255)," ",YourField)

Posted: Thu Nov 18, 2010 2:45 pm
by hsahay
chulett wrote:Did you try convert?

Code: Select all

Convert(CHAR(255)," ",YourField)
Yes i tried that. I got that from one of the previous post. But it did not work.

Posted: Thu Nov 18, 2010 3:03 pm
by FranklinE
There is an open question here: How is the text file from the mainframe being created?

If there is a separate download job/process that creates the file, then the easiest and most effective way to handle this is to make sure that process is doing the proper EBCDIC to ASCII conversions. It's possible you can configure it to convert extended-charset values to space during the download.

An alternative is to read the mainframe data from the mainframe with FTP Enterprise, if your environment supports it. This stage lets you define the input format for "COBOL" which provides the necessary defaults and lets DataStage handle the characterset incoming and for conversion to ASCII. I use that in jobs I'm developing right now.

Posted: Thu Nov 18, 2010 3:40 pm
by hsahay
Franklin,

Thanks for the answer.

But we cannot do anything with the file now. client is not ready give new file or allow us use mainframe file.

Posted: Fri Nov 19, 2010 9:49 am
by hsahay
Anyone please help me with this issue..

Posted: Fri Nov 19, 2010 10:27 am
by swapnilverma
plz try reading ur file in a server job instead of px and use same convert function ...

Convert(CHAR(255)," ",YourField)

let us knw if this resolve ?

Posted: Fri Nov 19, 2010 10:33 am
by Mike
How did you conclude that Char(255) is equivalent to COBOL LOW-VALUES?

LOW-VALUES has all zero bits... which would be Char(0)

Mike

Posted: Fri Nov 19, 2010 10:35 am
by chulett
Mike wrote:How did you conclude that Char(255) is equivalent to COBOL LOW-VALUES?
I've been wondering the same thing all along but decided to stick with the assertion that they are 255s rather than "low values". :?

Posted: Fri Nov 19, 2010 10:44 am
by Mike
Same reason I didn't chime in earlier... but since Convert of Char(255) doesn't work, the character must be something other then Char(255).

Mike

Posted: Fri Nov 19, 2010 10:51 am
by FranklinE
I assumed no problem with low-values because they are ASCII null.

I also wonder, from his replies so far, if his clients are tying his hands and expecting him to do handstands. :?