viernes, 26 de abril de 2013

Rutina: Año Bisiesto // Fisper-->Calmonth


data: year type /BI0/OICALYEAR,
      tri  type /BI0/OICALQUART1,
      dia  type c LENGTH 2,
      mes  type /BI0/OICALMONTH2,
      yearmes  type /BI0/OICALMONTH.

INCLUDE rs_bct_hr_update_rules_general.



***********
  clear: mes, year, dia, yearmes.
  year = COMM_STRUCTURE-CALMONTH(4).
  year = year + 1.
  mes  = COMM_STRUCTURE-CALMONTH+4(2).
  dia  = COMM_STRUCTURE-CALDAY+6(2).

  if mes eq '02'.
    concatenate year mes into yearmes.
    PERFORM CALCULATE_ULTIMO
        USING yearmes
               RECORD_NO
               RECORD_ALL
               SOURCE_SYSTEM
        CHANGING RESULT
                 RETURNCODE.
 else.
  concatenate year mes dia into RESULT.
endif.




************************************************************+
************************************************************

data: year type /BI0/OICALYEAR,
      tri  type /BI0/OICALQUART1,
      dia  type c LENGTH 2,
      mes  type /BI0/OICALMONTH2.

clear: mes, year.
  year = COMM_STRUCTURE-CALMONTH(4).
  year = year + 1.
  mes  = COMM_STRUCTURE-CALMONTH+4(2).
  dia  = COMM_STRUCTURE-CALDAY+6(2).
  if dia eq '29'.
    dia = '28'.
  endif.
  concatenate year mes dia into RESULT.


*************************************************************
*************************************************************

data: mes type /BI0/OICALMONTH2,
      year type /BI0/OICALYEAR.

clear: mes, year.

year = TRAN_STRUCTURE-FISCPER(4) .
mes = TRAN_STRUCTURE-FISCPER+5(2) .

if mes > 12.
mes = 12.
endif.

if mes = 00.
mes = 01.
endif.

concatenate year mes into RESULT.

No hay comentarios: