Date logic in COBOL

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Date logic in COBOL

Postby Ranjana » Wed Feb 03, 2010 6:11 pm


I have below requirement,
Get an input file which is having records along with dates in format CYYMMDD.Also we have from and to date from the job PARM.
Need to fetch an records which is falling between from and to dates.


Input file
Record1 mainframe forum 1 1090324
Record2 mainframe forum 3 1040523
Record3 mainframe forum 2 0960324

Date in Parm:
CYYMMDDCYYMMDD (From date and to date)

Record1 mainframe forum 1 1090324
Record2 mainframe forum 3 1040523

Please let me know how to find that the date in the input file is falling between the dates from PARM.

Posts: 9
Joined: Thu Jan 21, 2010 7:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Date logic in COBOL


Re: Date logic in COBOL

Postby Robert Sample » Wed Feb 03, 2010 6:59 pm

I recommend you find a copy of the COBOL Language Reference manual (if nowhere else, you can find one at and look up the IF statement.

And this type of forum works best on very specific questions, not the wide-open question you asked. Once you've read about the IF statement, and you are having a specific problem with coding, that would be the time to post a question.
Robert Sample
Global moderator
Posts: 3094
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 176 times

Return to IBM Cobol


  • Related topics
    Last post