A New Method for checking the renewal duration in the program

Source: Internet
Author: User
In actual application, we often need to check whether it is a new year? In general, we all use Digital computation. The following provides a simple method to share with you...

The command cvtdat already knows that the Year is the latest year, as long as the "0229" and the two-digit year are combined into the 'mmddyy' format,
The date numeric value of the command cvtdat. If the command cvtdat returns the numeric value "cpf0555 date numeric value or date format numeric value ",
It indicates that the two digit years are not the same year. If the two digit years are not the same, the two digit years are the same year.

Code:
PGM (& year)
DCL & year * char 2
DCL & mdy * char 6

Chgvar (& mdy) ('000000' * Cat & year)
Cvtdat date (& mdy) Tovar (& mdy) fromfmt (* mdy) tofmt (* mdy) tosep (* none)
Monmsg cpf0555 exec (DO)
Sndmsg msgid (cpf9898) msgf (qcpfmsg) +
Msgdta ('Year' * bcat & year * bcat 'is not leap year') +
Msgtype (* comp)
Return
Enddo
Sndmsg msgid (cpf9898) msgf (qcpfmsg) +
Msgdta ('Year' * bcat & year * bcat 'is leap year') +
Msgtype (* comp)
Endpgm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.