Constant day field in a date

40 pts.
Tags:
RPGLE
How do we set the Day of a Date to '01' through out an RPGLE program?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Use a DS to redefine the date and replace day with ’01′

Wilson

//////////

For date-type fields, do this:

DayOfMonth = %SubDt(DateField:*D);
MonthBegin = DateField – %Days(DayOfMonth – 1);

If your datefield is 08/14/2009, this code will subtract 13 days from that to get you to the first of the month.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Susweta
    How do we set the Day of a Date to '01' through out an RPGLE program? Also it should be applicable to any date taken?
    40 pointsBadges:
    report
  • WilsonAlano
    The answer of Litllepd is perfect for any date and doesn't need a DS. Wilson
    2,485 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following