iSeries PF Calendar File

260 pts.
Tags:
iSeries development
I am looking for some code which will create a calendar file with the following fields date 010108 day of week monday and week number based on 4 week cycle. Thanks for any help!

Answer Wiki

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

If you want ILE RPG

<pre>
h option(*nodebugio:*srcstmt) indent(‘|’)
h dftactgrp(*no) actgrp(*caller)

d main pr extpgm(‘TEST’)
d pStartDate 6a *MDY
d main pi
d pStartDate 6a *MDY

d currentDate s d
d currentYear s 4p 0
d outDate s 6p 0
d outWeekDay s 9a
d outWeek s 1p 0

c/exec sql
c+ set option
c+ datfmt = *iso,
c+ timfmt = *iso,
c+ naming = *sys,
c+ commit = *none,
c+ closqlcsr = *endmod,
c+ dlyprp = *yes
c/end-exec

c eval currentDate = %date(pStartDate:*mdy0)
c eval currentYear = %subdt(currentDate:*years)

c dou currentYear <> %subdt(currentDate:*years)
c eval outDate = %dec(currentDate:*mdy)
c/exec sql
c+ set (:outWeekDay, :outWeek) = (
c+ dayname(:currentDate),
c+ case mod(week(:currentDate),4) when 0 then 4 else
c+ mod(week(:currentDate),4) end )
c/end-exec

c* write rcdfmt
c eval currentDate += %days(1)
c enddo
c eval *inlr = *on
</pre>

Kevin C. Ketzler
<a href=”http://www.aresgrp.com”>Affiliated</a>

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
  • BigKat
    in what language??
    8,100 pointsBadges:
    report
  • JAC
    RPGLE preferably Thanks PS... Thanks Kevin
    260 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