PDA

View Full Version : initialize *ISO date



wjminc
01-01-1995, 02:00 AM
I want to initialize a date field that is definded as *ISO. I tried using PDATE, but that did not work. Do I have to build the YYYYMMDD field, then move it to my *IOS definded field?I was really hoping that all I had to do was defind a field as *ISO and then move a date to it and the system would do the rest. Thanks for any help... Willie

Guest.Visitor
04-30-1999, 04:37 AM
On Thursday, April 29, 1999, 08:19 AM, William Moore wrote: I want to initialize a date field that is definded as *ISO. I tried using PDATE, but that did not work. Do I have to build the YYYYMMDD field, then move it to my *IOS definded field? I was really hoping that all I had to do was defind a field as *ISO and then move a date to it and the system would do the rest. Thanks for any help... Willie <hr>Here's what I do: <pre> D iso_date s d datfmt(*iso) inz . . . c clear iso_date </pre> Seems to work for me. - Jo Ann 'Never argue with idiots. They drag you down to their level then beat you with experience.' - Dilbert

Guest.Visitor
04-30-1999, 08:17 AM
<hr> <font color="blue"> On Friday, April 30, 1999, 04:37 AM, Jo Ann Burelle wrote: On Thursday, April 29, 1999, 08:19 AM, William Moore wrote: I want to initialize a date field that is definded as *ISO. I tried using PDATE, but that did not work. Do I have to build the YYYYMMDD field, then move it to my *IOS definded field? I was really hoping that all I had to do was defind a field as *ISO and then move a date to it and the system would do the rest. Thanks for any help... Willie <hr>Here's what I do: <pre> D iso_date s d datfmt(*iso) inz . . . c clear iso_date </pre> Seems to work for me. - Jo Ann 'Never argue with idiots. They drag you down to their level then beat you with experience.' - Dilbert </font>

Guest.Visitor
04-30-1999, 05:11 PM
You can also specify INZ(*SYS) to initialise a date variable with the current date. Derek <font color="#0000CC">On Friday, April 30, 1999, 08:17 AM, Jon Erickson wrote: William, Jo Ann' method works, it initializes the field to low value, ('0000-01-01' I believe). The clear does the same. If you'd like to initialize to some other date, follow the inz with (d'yyyy-mm-dd') like so; Inz(d'1999-04-30'</font> <font > color="#000099">On Friday, April 30, 1999, 04:37 AM, Jo Ann Burelle wrote: Here's what I do: <pre>D iso_date s d datfmt(*iso) inz . . . c clear iso_date </pre> </font> <font color="#000066">On Thursday, April 29, 1999, 08:19 AM, William Moore wrote: I want to initialize a date field that is definded as *ISO. I tried using PDATE, but that did not work. Do I have to build the YYYYMMDD field, then move it to my *IOS definded field? I was really hoping that all I had to do was defind a field as *ISO and then move a date to it and the system would do the rest. </font>

Guest.Visitor
05-01-1999, 05:03 AM
On Friday, April 30, 1999, 05:11 PM, Derek Butland wrote: You can also specify INZ(*SYS) to initialise a date variable with the current date. Derek Derek, would that be system or job date? 'Never argue with idiots. They drag you down to their level then beat you with experience.' - Dilbert

Guest.Visitor
05-01-1999, 11:45 AM
On Saturday, May 01, 1999, 05:03 AM, Jo Ann Burelle wrote: <blockquote><tt>Derek, would that be system or job date? <hr> Jo Ann, That would be the system date. To get the job date use Inz(*JOB). This is available on V3R7. Also, in your RPG example, I think you meant to use the TIME opcode, not CLEAR. Chris </tt></blockquote>

Guest.Visitor
05-03-1999, 04:44 AM
On Saturday, May 01, 1999, 11:45 AM, Chris Ringer wrote: Jo Ann, That would be the system date. To get the job date use Inz(*JOB). This is available on V3R7. Also, in your RPG example, I think you meant to use the TIME opcode, not CLEAR. Chris Thanks for the info it'll replace udate and *date for most of my apps. I meant to use clear to initialize the date field. 'Never argue with idiots. They drag you down to their level then beat you with experience.' - Dilbert

daly.michael@verizon.net
05-10-1999, 11:14 AM
On Thursday, April 29, 1999, 08:19 AM, William Moore wrote: I want to initialize a date field that is definded as *ISO. I tried using PDATE, but that did not work. Do I have to build the YYYYMMDD field, then move it to my *IOS definded field? I was really hoping that all I had to do was defind a field as *ISO and then move a date to it and the system would do the rest. Thanks for any help... Willie Willie, I thought it would be a good idea to give you some general information on date handling rather than a specific solution to your field initialization question. If my "read-between-the-lines" meter is calibrated correctly, it looks like you wrote a statement that looks something like this: <pre> D DateISO S D DATFMT(*ISO) . C Move PDATE ISODate</pre> This will only work if PDATE is either (a) a 10-char alpha field in the format "YYYY-MM-DD", or (b) an 8-digit numeric field in the format YYYYMMDD. The reason being the MOVE opcode assumes the basic layout of the data matches the format of the date-type data field. This assumption is made because factor 1 is blank. To move a field with a different layout into this date field, simply specifiy the format of the NON-DATE field in factor 1. Like this: <pre> D PDATE S 8 0 INZ(05101999) D DateISO S D DATFMT(*ISO) . C *USA MOVE PDATE DateISO</Pre> In this example, the data in PDATE is in MMDDYYYY layout (i.e., *USA format). I told the MOVE opcode what to look for by specifying "*USA" in factor 1. This works for all different formats, whether the non-date field is factor 2 or the result. The rules are that six digit dates must be in a 6,0 numeric field or an eight character alpha field. Eight digit dates must be in either an 8,0 numeric or 10 alpha field. The alpha fields must contain the separator characters. There is an exception to the rules above such that if you specify the date format in factor followed by a zero ("*USA0") then the date separators are not necessary. <pre> D PDATE S 8A INZ("05101999") D DateISO S D DATFMT(*ISO) . C *USA0 MOVE PDATE DateISO</Pre> Hope this helps. Reply if you have any questions. Michael_D <hr><a > href="http://www.freshpoint.com"><imgsrc="http://www.freshpoint.com/graphics/f ooterlogo.GIF"border="0" width="162" height="48"></a><font > color="#408080"> The Fresh Produce Experts Michael Daly, Sr. P/A (972) 392-8169</font>