5 pts.
 Build a AS/400 calendar file
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
ASKED: July 9, 2010  5:42 PM
UPDATED: July 12, 2010  2:21 AM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 107,845 pts.

 

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

 44,110 pts.