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

How to avoid junk data ?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 355
Location: New York

PostPosted: Mon Jun 19, 2006 5:12 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top