Post by a***@deejaymail.itcon il nuovo anno, la nostra procedura di calcolo del numero della
settimana nell'anno è impazzita.
Avete mica un qualcosa di già fatto che funzioni ?
Il dato mi serve all' 'italiana'
1=lun 2=mar .. 7=domenica
la prima settimana è fino al primo sabato dell'anno e cosi via.
se fosse bastata la convenzione ISO avrei risolto con sql.
Vi chiedo una cosa già fatta in quanto stiamo sbagliando
ll'attribuzione del codice lotto di produzione, quindi volevo
evitare di perdere del tempo a rifare e testare una cosa da zero.
The following SQL scalar functions:
_i DAYNAME i_ "Returns a mixed case character string containing the
name of the day (for example, Friday) for the day portion of the
argument. ... Note: National language considerations: The name of the
day that is returned is based on the language used for messages in the
job. This name of the day is retrieved from message CPX9034 in message
file QCPFMSG in library *LIBL."
_i WEEK_ISO i_ "The WEEK_ISO function returns an integer between 1
and 53 that represents the week of the year. The week starts with
Monday. Week 1 is the first week of the year to contain a Thursday,
which is equivalent to the first week containing January 4. Thus, it is
possible to have up to 3 days at the beginning of the year appear as the
last week of the previous year or to have up to 3 days at the end of a
year appear as the first week of the next year."
_i DAYOFWEEK_ISO i_ "The DAYOFWEEK_ISO function returns an integer
between 1 and 7 that represents the day of the week, where 1 is Monday
and 7 is Sunday."
ILE RPG Examples "RPGLE - Day of week/Week of year" with Procedure:
DayOfWeek [although that may require adjustment by adding one] and
Procedure: WeekOfYear" [among others]:
http://www.code400.com/viewsamples.php?lang_id=1
There are also the ILE Common Execution Environment APIs, with an
example for day-of-week; knowing of these may enable finding others:
_i Examples: Using ILE Common Execution Environment data APIs i_
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/apis/apiexusdata.htm
"...
... callb(d) 'CEEDAYS'
... callb(d) 'CEEDYWK'
... callb(d) 'CEEDATE'
...
"
Regards, Chuck