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

Hi,

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.

Example:

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

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

Outputfile:
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.

Thanks,
Ranjana
Ranjana
 
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 http://www.s390.ibm.com) 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: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post