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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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