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

Reading a flat file for a particular position


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

New User


Joined: 09 Oct 2006
Posts: 31
Location: Bangalore

PostPosted: Mon Feb 19, 2007 5:56 pm
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Feb 19, 2007 6:36 pm
Reply with quote

Read the flat file and compare the fields for spaces, alpha and numeric, and write on failure?
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Tue Feb 20, 2007 10:01 am
Reply with quote

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
Code:

FILE-REC(39:61)


it'll contain the values of 39 to 100 positions...now compare
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 20, 2007 9:53 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top