Is there a way to skip records in COBOL?
I need to read an input file and validate it. While validating input records, I need to see if there are any invalid records, if yes, I have to skip processing for that records and process next records. If I continue to read the next record will it break the loop or keep on processing next records? Please suugest.
Skip and continuew reading in COBOL.
-
- Registered Member
- Posts: 31
- Joined: Thu Oct 03, 2013 1:32 pm
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Skip and continuew reading in COBOL.
No there is no way to skip reading records with COBOL sequential files. If you are reading a sequential file, you read record 1, then record 2, then record 3, then .... until the end of file. HOWEVER, there is nothing in COBOL to prevent you from reading a record and then immediately reading the next record without doing anything to the former record.
-
- Registered Member
- Posts: 31
- Joined: Thu Oct 03, 2013 1:32 pm
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Skip and continuew reading in COBOL.
I think no language can do skipping of records - it's "logic" which "mimics" it, no?
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute