Build a AS/400 calendar file

5 pts.
AS/400 commands
RPG Code
I need to build a calendar file with date '010110' and day of week 'SU' in rpg/400.  The client does not use the ILE envionment.  Can anyone provide the RPG code to create this file?  Thanks

Software/Hardware used:
AS/400 RPG/400

Answer Wiki

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


Discuss This Question: 4  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.
  • TomLiotta
    RPG doesn't "create" files. You use DDS or SQL to create files. It isn't clear at all what you need to do. I'd guess that you want to create a file that has a row for every day of the year. Each row has two columns. The first column is a date in MMDDYY format, and the second column contains a 2-character abbreviation for the day of the week. Am I close? You might not know the answer, but I have to ask if you know why your client deliberately chooses to cripple their system by avoiding better features? Are they also still using Windows 98 and FAT file systems on PCs? Tom
    125,585 pointsBadges:
  • philpl1jb
    I would create a table with three columns Julian Date , MMDDYY date, day code. Julian dates for this year run from 10001 to 10365 -- a fairly simple program can generate these numbers. Then call cvtdat for each julian to get the mmddyy and I think it might return day name -- or we've shown the code a number of times to get the day name. Phil
    54,090 pointsBadges:
  • azohawk

    In my time, I have encountered a number of differenct calendar files. All have had multiple fields that may have included such things as YYYYMMDD, MMDDYYYY, CYYMMDD, YYMMDD, MMDDYY, long date (i.e. May 12, 2015), Julian Date, Hundred Year date (6 digit-if you are not using ile, this can be useful in determining days between date, particularly when dates cross years), Day of the week (expressed with 1, 2, and 3 alpha fields and full name), Months, days and years as separate fields, Workday/Holiday identifier field, Financial period (YYMM, MM, or  other), Week no., day of the financial period, week of the financial period.

    Of course no single calendar contained all of these fields, but my point is that you can do a lot with a calendar file, however you first need to understand what is needed to best build it right the first time.

    4,055 pointsBadges:
  • ToddN2000
    In my experience, unless you use a century and or 4 digit year before the MM DD. It makes sorting and sequencing a nightmare. My preferred format is yyyymmdd. Just my 2 cents. Are you looking to auto populate the table with dates?
    133,790 pointsBadges:

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.

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


Share this item with your network: