To find month end dates

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

To find month end dates

Postby jasand » Wed Jul 28, 2010 5:12 pm

Can you help me how to find the month end dates using COBOL pgm

Please let me know how to get the below requirement.
I need to manipulate the system run date and get last two month's end dates.

For eg: If today is June 1st or 3rd,
then the output file (FB/80) should hold 'May' and 'April' month end dates.

The output file should hold a single record as below,

ABCDEFG - constant
XX - a parm value (alphabetic) (Can we pass the parm value in the SORT JCL ?)
0000 - constant
053110 - date field (MMDDYY - May month's end date)
043010 - date field (MMDDYY - April month's end date)

Posts: 11
Joined: Fri Mar 12, 2010 5:41 pm
Has thanked: 1 time
Been thanked: 0 time

Re: To find month end dates

Postby Robert Sample » Wed Jul 28, 2010 5:23 pm

To answer the easy question first:
XX - a parm value (alphabetic) (Can we pass the parm value in the SORT JCL ?)
If you are wanting to use PARM= on the sort step, certainly -- as long as you mean another job that will be submitted. If you mean the currently executing job, you need to be aware that once a job stream is submitted the JCL is fixed and cannot be changed by any executing process. If you mean to have a file read by SORT to pick up a parameter, you would need to post that in the appropriate sort forum for an answer.

As far as your requirement for month ending dates: do you not know how to code an IF or EVALUATE statement? If not, please go read the COBOL manual until you do understand both statements. If you do know how to code an IF or EVALUATE statement, why are you asking here instead of just coding it yourself? There is nothing tricky about the logic.
Robert Sample
Global moderator
Posts: 3686
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 274 times

Return to IBM Cobol


  • Related topics
    Last post