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
 

 

How to avoid junk data ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Mon Jun 19, 2006 4:58 pm    Post subject: How to avoid junk data ?
Reply with quote

Hi All,

I have a problem , i am creating a file whose input file has some corrupt data . Thus , the o/p file is having the same too. So that is causing problem in FTP process as the data when downloaded is in junk format for some fields (the file which i create is ftp ed to a diff vendor ). I cannot change the input file , thus while populating the o/p field i have put in a patch like given below ..

Code:
01  WS-ALPHA-CHECK               PIC X(01).                   
    88  WS-ALPHA-CHECK-VALID     VALUE 'A' 'B' 'C' 'D' 'E' 'F'
                                       'G' 'H' 'I' 'J' 'K' 'L'
                                       'M' 'N' 'O' 'P' 'Q' 'R'
                                       'S' 'T' 'U' 'V' 'W' 'X'
                                       'Y' 'Z' ' ' '+' '-' ','
                                       '1' '2' '3' '4' '5' '6'
                                       '7' '8' '9' '0' '/' '%'
                                       '"' '(' ')' '#' '.' .   


Thus it checks for valid value then populate the o/p file . But , is there any better way that i can check for alphabets and special charchters ,numbers without using this sort of logic ?

Thanks in advance .
Back to top
View user's profile Send private message

ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon Jun 19, 2006 5:12 pm    Post subject:
Reply with quote

Hi saithvis2,

I understood the following from ur query.

Instead of writing all alphabets and numbers in value clause, u want to write a smart statement.

If my understanding is right. Following may one may solve ur problem.

Instead of writing all alphabets from "A" to "Z", u can use IS ALPHABETIC clause to check all alphbets. To check numbers, u can use IS NUMERIC clause and for special chanracters, as for as I know, u have to code indivisually.

Please correct me if I am wrong.

ksk
Back to top
View user's profile Send private message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Mon Jun 19, 2006 5:27 pm    Post subject: Re: How to avoid junk data ?
Reply with quote

Hi Ksk,

Thanks for the quick reply . Yeah u got my problem , yes i was thinking of
changing for alphabets and numbers but can we handle the special charchters too my any smarter way . 'coz i dont know of any ? If you do come across or any body else , please do inform me.

Anywayz Ksk ..thanks again.


Regards,
Vishal
Back to top
View user's profile Send private message
Mohamed Riyaz Y

New User


Joined: 08 Jun 2006
Posts: 2
Location: Chennai, India

PostPosted: Mon Jun 19, 2006 7:00 pm    Post subject:
Reply with quote

Hi Vishal,

You can use SPECIAL-NAMES option.

environment division.
configuration section.
special-names
class name is "a" thru "z",
"A" thru "z", "1" thru "9",
" ", "'",".","- ","+","/","*"

you can find many things regarding special-names and coding in cobol
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG30/CCONTENTS?SHELF=IGY3SH31&DN=SC27-1412-03&DT=20050628164603

Thank you
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
No new posts Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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