Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us