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

How can i get only first and last record info in cobol


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

New User


Joined: 09 May 2005
Posts: 4

PostPosted: Tue May 10, 2005 4:16 pm
Reply with quote

Hi all.
Here is an interview question:
How can I get only the first and the last record information into the output in a cobol program?
Are there any cobol Statements available to access exactly first and last records of a file?

Please let me know the solution with piece of code if possible.

Thanks,
crreddy.
Back to top
View user's profile Send private message
ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Tue May 10, 2005 5:51 pm
Reply with quote

You can read an i/p file once & write the o/p. Then keep on reading till the end of input file. When the end of file is encountered, write the record. Thus both first & last records can be written.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top