IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Finding and removing Junk characters from a PS file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Thu Apr 29, 2010 1:13 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 1:58 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Apr 29, 2010 2:23 pm
Reply with quote

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
View user's profile Send private message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Thu Apr 29, 2010 3:20 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 3:46 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Apr 29, 2010 4:23 pm
Reply with quote

This might be helpful -

ibmmainframes.com/viewtopic.php?p=143786&highlight=#143786

Bill
Back to top
View user's profile Send private message
dipakgoyal
Warnings : 1

New User


Joined: 02 Aug 2007
Posts: 18
Location: Kolkata

PostPosted: Thu Apr 29, 2010 4:30 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 29, 2010 4:34 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 4:44 pm
Reply with quote

how to 1.1.2.4 Defining a user-defined class
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top