View previous topic :: View next topic
|
Author |
Message |
dipakgoyal Warnings : 1 New User
Joined: 02 Aug 2007 Posts: 18 Location: Kolkata
|
|
|
|
Hi,
I have a cobol program which
1. reads an input file (this is a ftp file, so beyond our control)
2. Load value from this file to a table.
Now, a particular column in the table, defined as CHAR(30) NOT NULL, sometimes get junk values. ( means when we display the data using SPUFI, instead of spaces, dots appear). We need to get rid of this.
This column gets its value from the input file, which contains junk data.
Now the problem is. how can we identify the junk data?
Means if we have some way of capturing like
IF INP-FILE-COL1 IS .....
MOVE SPACES TO INP-COL1
END-IF.
Though the same problem has been discussed in:
ibmmainframes.com/post-94542.html
but can we do it in cobol itself instead of doing it through REXX?.
Apart from this, can any one tell me if the JUNK characters are different from LOW VALUES or are they ALPHANUMERIC? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Apart from this, can any one tell me if the JUNK characters are different from LOW VALUES or are they ALPHANUMERIC?
|
May be.. .May not be...
It solely depends on you what to call as JUNK |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Nice to see that you have searched the Forum. But in circumstances like yours, one need to first decide on what is "junk"? What are the rules to "call" something as "junk"? You said you get file by some ftp process - does the file contain ASCII characters? If something is non-display characters, not necessarily it's a "junk" - it's just the system you are at, can't read it. And why is it that you want to remove the non-display (P'.') characters? |
|
Back to top |
|
|
dipakgoyal Warnings : 1 New User
Joined: 02 Aug 2007 Posts: 18 Location: Kolkata
|
|
|
|
I need to remove the non-display characters. since I load a table using this fields ( as earlier stated ), and then, other programs use that table to generate some reports. Now since the input file, and then in turn table and reports also contain these characters ( I won't call them junk now), when we try to upload them, they fail !
As of now, the current practice is that we open the data-set(reports) in edit mode, issue the command : C ALL P'.' ' ' , and save it. We want that erroneous data should be handled right at the time of table - loading. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you can add code in your cobol program,
using alphanumeric class condition check,
and upon failure,
use the INSPECT CONVERTING statement,
which would effectively mimic the Chg All P'.' ' '. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
dipakgoyal Warnings : 1 New User
Joined: 02 Aug 2007 Posts: 18 Location: Kolkata
|
|
|
|
Thanks Dick, for the answer.
Please confirm one thing:
LOW-VALUES and HIGH-VALUES which are also non-displayable, come under the category of APLHANUMERIC.
( www.ibmmainframes.com/about29901.html )
Aren't the other non-displayable chars, too, alphanumeric in class?
If yes, it won't fail the alphanumeric class condition check. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
If yes, it won't fail the alphanumeric class condition check. |
Please click on the manuals link above, find the COBOL Language Reference manual, and find which page the ALPHANUMERIC class condition is located on.
You will find there is no such thing in COBOL as an ALPHANUMERIC class condition, so your statement is nonsense. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
|