Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Finding and removing Junk characters from a PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Finding and removing Junk characters from a PS file
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:
http://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    Post subject:
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

Senior Member


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

PostPosted: Thu Apr 29, 2010 2:23 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 3:46 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Apr 29, 2010 4:23 pm    Post subject: Reply to: Finding and removing Junk characters from a PS fil
Reply with quote

This might be helpful -

http://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    Post subject:
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.
( http://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: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 29, 2010 4:34 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Apr 29, 2010 4:44 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us