Logic for month change

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Posts: 2
Joined: Sun Aug 27, 2017 1:50 am

Logic for month change

Post by prax1 » Sun Aug 27, 2017 2:00 am

I am a beginner in COBOL. I have a file like below

Agent No Date Amount
xxx 07/17 100.00
xxx 07/17 200.00
xxx 07/17 10.00
xxx 07/17 105.00
xxx 08/17 100.00

I have a requirement like .....read the the file, as the long as the month does not change, accumulate the amount. As soon as the month changes write the total to output file(like for example above the month changes to 08/17)

Now, my question is how do i write logic for changing month in COBOL program? Any suggestions please

Posts: 2
Joined: Sun Aug 27, 2017 1:50 am

Post by prax1 » Sun Aug 27, 2017 11:40 am

Hello Dear Experts,
Request you please respond to above question. Thanks in advance

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others