An interesting point here... rather than specifying the format on the move, you can specify the format when defining the DATE field (including the ability to override the separator). Doing that, you can then just move your character or numberic data in and out of the date field without specifying an attribute in factor 1. Later, the dates can be used as normal for calculations. To "convert" the format, you can move one date to another, then move the second date field to your output field. Here's a second program that illustrates these features: d ddefault S D DATFMT(*MDY) d dslashes S D DATFMT(*MDY/) d dcommas S D DATFMT(*MDY,) d ddots S D DATFMT(*MDY.) d diso S D DATFMT(*ISO) C* C move '01/01/82' cslashes 8 C move '01,01,83' ccommas 8 C move '01.01.84' cdots 8 C* c move cslashes ddefault c move cslashes dslashes c move ccommas dcommas c move cdots ddots C* c ddefault subdur dcommas days:*d 3 0 C* c move ddots diso c move diso ciso 10 C* c move *on *inlr
At the end of this, days is -365, and ciso is "1984-01-01". Pretty cool stuff. Joe
src="//www.zappie.net/java/_derived/index.htm_cmp_zero110_vbtn_p.gif" width="140" height="60" border="0" alt="Java400.net - Java/400 Freeware" align="middle"> Java400.Net - where the AS/400 speaks Java with an RPG accent Home of PBD2.0, the color=red>FREE Java/400 Client/Server color=blue>Revitalization Toolkit