You can easily change it to fit the format you are familiar with in your part of the world. I am using this format as I am in the USA. Line 15: Let me put all of that together. Line 14: YEAR returns the year from the date as a numeric value. Line 13: MONTHNAME returns the name of the month, in mixed case. For example if today is the 15th it returns 15. Line 12: DAYOFMONTH return the numeric value of the day of the month. Line 11: DAYNAME returns the name of the day of the week, in mixed case. Line 10: DAYOFWEEK returns a single numeric value to represent the day of the week. Unlike that program, where he has to pass UDATE to get the data for today. I don't have to use a parameter with these functions. The only thing I will say is that the data type ZONED, lines 3, 4, and 6, is the equivalent of "signed" numeric in fixed format definitions.ġ0 exec sql SET :DayNumber = DAYOFWEEK(CURRENT DATE) ġ1 exec sql SET :DayName = DAYNAME(CURRENT DATE) ġ2 exec sql SET :DayOfMonth = DAYOFMONTH(CURRENT DATE) ġ3 exec sql SET :MonthName = MONTHNAME(CURRENT DATE) ġ4 exec sql SET :YearNumber = YEAR(CURRENT DATE) ġ5 FullDateString = %trimr(DayName) + ' ' +ġ6 dsply ('Today is ' + FullDateString) īy using CURRENT DATE in these statements it will always the date for today, whether I run this tomorrow, next week, next month, etc.
RPGLE EDIT WORD CODE
I am not going to explain much about this code as you regular readers of this blog will know what all this means. Let me start with the section where I define all my variables. I consider the code for this is so simple, I am going to jump straight into it with no further explanation. I have mentioned them in a previous post about date functions in SQL, and feel it is worth repeating.
![rpgle edit word rpgle edit word](https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1604785791l/42036965._SY475_.jpg)
His old program is passed a date, as a number, and returns: He disputed that I could, and the challenge was on. "I can do what your program does in just a few lines of code," I explained. My programming nemesis, the " I can do everything you do in RPGIV just as well using RPGIII" guy, was bragging that no-one could write a better way of changing a date into words than his old RPG38 program.
![rpgle edit word rpgle edit word](https://www.ibm.com/support/pages/system/files/support/nas/nastech.nsf/0/b4e530622bf4691c85257bc100613f96/Content/26.2E3E.gif)
Input 4 35A: |LL ST JAMES TAXES STATES STAND CITY|ĭestination Field 3 40A: |Johnan Stress bay White hall |- The 'bay ' world with space remainĭestination Field 4 40A: |CHIGNALL ST JAMES TAXES STATES STAND CI|- Prompt error msg as the 'TY' no enough fit in the 40 length fieldĪppreciated with any help,Thanks.Sorry with my poor English.The idea for this post came from a meeting of the programming managers at work. 1241,Old Klang road, Tom |ĭestination Field 2 40A: |Caterrried ,58785 Windfall Stand |ĭestination Field 3 40A: |Johnan Stress bay White hall |- The 'bay ' world remainĭestination Field 4 40A: |CHIGNALL ST JAMES |
![rpgle edit word rpgle edit word](https://i.stack.imgur.com/fWubf.png)
Input 3 35A: | Stress bay White hall CHIGNA|Įxpected result store to 4 line destination fields with 40A each of line.ĭestination Field 1 40A: |No. Input 2 35A: |rried ,58785 Windfall Stand Johnan| It also will prompted errorĪfter movement input word if the destination fields length no enough long to store total four input fields. Then will move last word of input line field 1 to destination field 2.Same rules will applied to destination field with line 2 ,3,4. I have four 35A input fields condition with if character at position 35A of input line 1 is not a space and first character of input line 2 is not space,
![rpgle edit word rpgle edit word](https://an1.com/uploads/muirehgurteghrt.png)
I have encounter issues about sub string with from input and store in destination fields with different field length.