                 C O N V D A T E  and  C A L L D A T E



      CONVDATE help to transform dates or to obtain information from 
a date. Is available in every environment both as stand alone program
and as linkable routine named CALLDATE.


      Input can be:

- a date in the form DD/MM/YY or DD/MM/YYYY
- una data nella forma YYYY/DDD  (where DDD is day in form of progressive
  number from beginning of the year)
- an integer number preceded by sign '+' (or '-'):
  in this case input date is current date plus (or minus) the specified
  number of days
- an integer number bigger than 2305448, that is the Julian Day (absolute,
  that is the Julian day used in astronomy)


      Independently from the format of the input date, output is this:

- Date in format DD/MM/YYYY (10 bytes)
- Progressive day from start of year (3 bytes)
- Flag if year is a leap year (1 byte); if it is, flag is "B",
  otherwise is blank
- Month name (in english and in uppercase) (9 bytes)
- Week day (1 byte): 1 = MONDAY, 2 = TUESDAY etc.
- Week day name (in english) (10 bytes)
- Flag for workday (L) or holiday (F) (1 byte)
- Progressive number of week (2 bytes) from 1 to 52
- Julian Day     (8 bytes)
- "Lettera domenicale": a number from 0 to 7 (1 byte) 0=A, 1=B, etc.
  is 0 if the first day of year is sunday, is 1 if is monday, and so on
- "Lettera domenicale" of the month (1 byte) 0=A, 1=B, etc.
  is 0 if the first day of month is sunday, is 1 if is monday, and so on
- Easter expressed as  DD/MM              (5 bytes)
- Easter expressed as progressive day DDD (3 bytes)
- Elapsed days from current date (6 bytes) (negative for a date in the 
  future).

  All this informations are displayed in the screen if it is a stand-alone
program or are returned to a calling program in a record of length 80 if
is a callable routine (named CALLDATE).

  Per un programma COBOL:

       01  DATA-OUTPUT.
           05  DATA-ERROR                PIC  X(1).
           05  FILLER                    PIC  X(1).
           05  DATA-DATA.
               10  DATA-DATA-GG          PIC  9(2).
               10  FILLER                PIC  X(1).
               10  DATA-DATA-MM          PIC  9(2).
               10  FILLER                PIC  X(1).
               10  DATA-DATA-AAA         PIC  9(4).
           05  FILLER                    PIC  X(1).
           05  DATA-PROGRESSIVO          PIC  9(3).
           05  FILLER                    PIC  X(1).
           05  DATA-BISESTILE            PIC  X(1).
           05  FILLER                    PIC  X(1).
           05  DATA-NOME-MESE            PIC  X(10).
           05  FILLER                    PIC  X(1).
           05  DATA-NUMERO-GIORNO        PIC  9(1).
           05  FILLER                    PIC  X(1).
           05  DATA-NOME-GIORNO          PIC  X(10).
           05  FILLER                    PIC  X(1).
           05  DATA-FESTIVO              PIC  X(1).
           05  FILLER                    PIC  X(1).
           05  DATA-SETTIMANA            PIC  9(2).
           05  FILLER                    PIC  X(1).
           05  DATA-GIORNO-GIULIANO      PIC  9(8).
           05  FILLER                    PIC  X(1).
           05  DATA-LETTERA-DOM          PIC  9(1).
           05  FILLER                    PIC  X(1).
           05  DATA-LETTERA-MESE         PIC  9(1).
           05  FILLER                    PIC  X(1).
           05  DATA-PASQUA.
               10  DATA-PASQUA-GG        PIC  9(2).
               10  FILLER                PIC  X(1).
               10  DATA-PASQUA-MM        PIC  9(2).
           05  FILLER                    PIC  X(1).
           05  DATA-PASQUA-PROG          PIC  9(3).
           05  FILLER                    PIC  X(1).
           05  DATA-GIORNI-PASSATI       PIC S9(6).

      Note that every information is separed from the following by a 
FILLER of a blank.


  For an Assembler program:

         DATOUT    DS   0CL80
         DATERROR  DS    CL1
                   DS    CL1
         DATDATA   DS   0CL10
         DATDATGG  DS    CL2
                   DS    CL1
         DATDATMM  DS    CL2
                   DS    CL1
         DATDATAA  DS    CL4
                   DS    CL1
         DATPROGR  DS    CL3
                   DS    CL1
         DATBISES  DS    CL1
                   DS    CL1
         DATMESE   DS    CL10
                   DS    CL1
         DATMESEN  DS    CL1
                   DS    CL1
         DATGIORN  DS    CL10
                   DS    CL1
         DATFEST   DS    CL1
                   DS    CL1
         DATSETT   DS    CL2
                   DS    CL1
         DATJD     DS    CL8
                   DS    CL1
         DATLETDO  DS    CL1
                   DS    CL1
         DATLETME  DS    CL1
                   DS    CL1
         DATPASQU  DS   0CL5
         DATPASGG  DS    CL2
                   DS    CL1
         DATPASMM  DS    CL2
                   DS    CL1
         DATPASPR  DS    CL3
                   DS    CL1
         DATGIPAS  DS    ZL6


First byte is error code, if in input there is a wrong value; can be
one of this characters:

  L = Record area in output with length less then 80 bytes (this error is
      returned only for CICS version, with output returned in Commarea)
  N = Not numeric Date (or incomplete)
  G = Day wrong (>31 o <1)
  M = Month wrong  (>12 o <1)
  A = Year wrong   (>2199 o <1600)
  I = Inconsistent date (i.e: 31/11 or 29/2 in non leap year);
      processing continue
  J = Julian day out of range



      Program is available in stand-alone form in interactive environment
as VM/CMS, MVS/TSO and CICS; to recall it write program name with
the input date sideways; output will be displayed on the screen.
      Program is available as linkable routine in DOS VSE/SP and
MVS BATCH; input date must be supplied in the same area used to
obtain informations from the routine;
To recall from a Cobol program is better to do a REDEFINE of 
DATA-OUTPUT as DATA-INPUT and then do:

           MOVE  my-date TO DATA-INPUT.
           CALL 'CONVDATE' USING DATA-OUTPUT.

      Finally, in CICS environment, stand-alone version of the program
can be recalled also from another program with EXEC CICS LINK, in which
is passed a Commarea of 80 bytes, that is both input and output.
For example:

           MOVE  my-date TO DATA-INPUT.
           EXEC CICS LINK PROGRAM('CONVDATE') COMMAREA(DATA-INPUT)
                LENGTH(80)


Note:
  Managed calendar range is from 1/1/1600 (corresponding to a Julian day
  2305448) to 31/12/2199 (Julian day 2305448); in this range Gregorian
  reform is correctly managed, that is years  1700, 1800, 1900 and 2100 
  are NOT leap year. 
  Julian calendar (in use before Gregorian reform) is not managed.

