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
 

 

Reading a flat file for a particular position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Reading a flat file for a particular position
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: 3158
Location: Tucson AZ

PostPosted: Mon Feb 19, 2007 6:36 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Feb 20, 2007 9:53 pm    Post subject:
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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