View previous topic :: View next topic
|
Author |
Message |
lal_arun_272
New User
Joined: 09 Oct 2006 Posts: 31 Location: Bangalore
|
|
|
|
Hi all,
I have a question,
I have to read a flat file and check in 39 to 100 positons, if it is having any thing other than space,aplabet,numeric write that record in to output file.
How can i do it?
Regards,
Lal |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Read the flat file and compare the fields for spaces, alpha and numeric, and write on failure? |
|
Back to top |
|
|
arindam111
New User
Joined: 29 Nov 2006 Posts: 27 Location: India
|
|
|
|
Read the flat file, say your first lline is in..
Code: |
01 FILE-REC PIC X(400).
|
Now if you get 39 to 100 positions...use this
it'll contain the values of 39 to 100 positions...now compare |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You will first need to make a list of which are the acceptable characters and which are not acceptable. For example - is lower case vaild? Are the ',' '.' '!' etc valid?
Once you have figured out which characters are "keepers" you can then compare positions 39-100 to determine if this record is to be written to the output file or not. |
|
Back to top |
|
|
|