Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8201
Location: East Dubuque, Illinois, USA

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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us