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

how to get 1yr old record by using cobol


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

New User


Joined: 05 Aug 2010
Posts: 1
Location: chennai

PostPosted: Thu Aug 05, 2010 6:20 pm
Reply with quote

my requirement is to delete the records which are 1yr old.
eg: if today is 20100805, then in my file the records having the date 20090805 should not be there.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 05, 2010 6:22 pm
Reply with quote

If the file is sequential, you'll need to read each record, decide whether or not to keep it, then write the records to be kept to a new file.

If the file is VSAM KSDS, you can directly delete the records -- but you'll need logic to process through the file sequentially unless the date field is part of a key.
Back to top
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Thu Aug 05, 2010 7:53 pm
Reply with quote

If sequential file, Read it untill end of file and check for the date. Its staright forward, let us know if you are struck somewhere while coding.
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