View previous topic :: View next topic
|
Author |
Message |
Aniyaa
New User
Joined: 07 Dec 2007 Posts: 26 Location: Bangalore
|
|
|
|
When I unload some records from the db2 table . A particular field has got some nondisplayable noneditable characters .
I want to read this field and remove the nondisplayable/noneditable characters from this field.
For eg ABC DEF
The space indicates a nondisplayable/noneditable character .
I want it as ABCDEF
How can this be done.
Thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
When I unload some records from the db2 table . A particular field has got some nondisplayable noneditable characters . |
What is the definition of that field in table?
Quote: |
The space indicates a nondisplayable/noneditable character . |
Non displayable is ok, but could you explain why non editable? |
|
Back to top |
|
|
Aniyaa
New User
Joined: 07 Dec 2007 Posts: 26 Location: Bangalore
|
|
|
|
nondisplayable and noneditable means that even if you open the dataset in edit mode you can't edit that particular character.
for eg , if there is a tab represented by X(05) (in mainframes) in the field |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
FIND P'.' will bring you to non-display type char. It will also let you know the X'??' value.
I will skip over the normal, why do you want to do this? and proceed directly to an answer.
you can change non-display types with a
Code: |
CHANGE ALL P'.' ' '
or
CHANGE ALL P'.' '' |
the first will replace all with space, the second will actually remove the char, effectively shifting everthing on the line.
in your case, this dumped column is hopefully lined up, (lets pretend that this ABC?DEF is in columns 11 thru 17. then you could use:
Code: |
CHANGE ALL P'.' ' ' 11 17
or
CHANGE ALL P'.' '' 11 17 |
this will preclude removing non-displays in other columns. |
|
Back to top |
|
|
Aniyaa
New User
Joined: 07 Dec 2007 Posts: 26 Location: Bangalore
|
|
|
|
Actually I forgot to mention that i need to do this using a cobol program.. its not a one-time thing , it needs to be done daily on the input file. I need a cobol statement to do the same.
Suppose the field is NAME from the input file .
I need to ensure that NAME has no such characters.
Sorry I dint' mention this before . |
|
Back to top |
|
|
Aniyaa
New User
Joined: 07 Dec 2007 Posts: 26 Location: Bangalore
|
|
|
|
What I was looking for is something like
INSPECT field-name REPLACING P'.' BY ' '
but the above doesn't work |
|
Back to top |
|
|
Aniyaa
New User
Joined: 07 Dec 2007 Posts: 26 Location: Bangalore
|
|
|
|
Hi ,
I am happy to inform that i got the solution
its
INSPECT field-name REPLACING ALL LOW-VALUES BY SPACES
its works. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Good You got the solution,
but.... what about investigating why those hex bytes were there ??? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
INSPECT field-name REPLACING ALL LOW-VALUES BY SPACES |
This will not do what you posted you need. . .
Quote: |
For eg ABC DEF
I want it as ABCDEF |
The statement you posted will still have a space in the middle. It will also replace x'00' and you mentioned x'05'.
If your orginal requirement was correct, your "solution" cannot work. . . |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
One of the UNLOAD utilities (I don't recall which one) separates the columns of the rows by a byte of X'00'. I suspect that's where the low-value bytes are coming from. |
|
Back to top |
|
|
|