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
 

 

how to get 1yr old record by using cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: how to get 1yr old record by using cobol
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: 7996
Location: Bellevue, IA

PostPosted: Thu Aug 05, 2010 6:22 pm    Post subject:
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    Post subject: Reply to: how to get 1yr old record by using cobol
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    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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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