John McKown wrote on 06/26/2009 05:57:30 AM:
> DFSORT has some wonderful abilities to convert encoded date/times to
> various printable outputs. These include SMF's PL4'0cyyddd' as well
> as TOD (STCK output) and ETOD (STCKE output). But I ran into one
> that is not there. I was writing a report from DCOLLECT data. The
> DCOLLECT date format is PL4'yyyyddd'. DFSORT does not have a
> conversion for this. OK, you Brainiacs out there probably see how to
> get around this already. Simply subtract PL4'1900000' and you have
> converted the date to the SMF format of PL4'0cyyddd'. However, there
> is still one problem. Sometimes the dates are PL4'0' as a "missing
> value". So if you simply subtract 1900000 from that and then use one
> of DFSORT's date conversions on it, the result is "interesting". So
> what I do, as an example for those who might be interested, is use
> the INREC and the IFTHEN.
>
> INREC IFTHEN=(WHEN=(117,4,PD,GT,1900001),
>                           OVERLAY=
(117:109,4,PD,SUB,+1900000,TO=PD,LENGTH=4),
>                           HIT=NEXT)
>
> I then use the OUTREC to convert something like:
>
> OUTREC FIELDS=(117,4,DT1,EDIT=(TTTT-TT-TT))
>
> The only problem with this, which I haven't yet bothered to fix, is
> the PL4'0' input ends up with a date of ZL10'1900-01-00' in my output.
>

I think you meant:

 INREC IFTHEN=(WHEN=(117,4,PD,GT,1900001),
         OVERLAY=(117:117,4,PD,SUB,+1900000,TO=PD,LENGTH=4))

But a better way to do this would be to use these DFSORT statements which
will
give 0000-00-00 (or whatever else you want to plug in) for the 0 date.

  OPTION COPY
  INREC IFOUTLEN=10,
   IFTHEN=(WHEN=(117,4,PD,EQ,0),
    BUILD=(C'0000-00-00')),
   IFTHEN=(WHEN=NONE,
    OVERLAY=(11:117,4,PD,SUB,+1900000,TO=PD,LENGTH=4,
             1:11,4,DT1,EDIT=(TTTT-TT-TT)))

> Many thanks to the DFSORT people for those date conversions. I'm
> able to write ICETOOL reports which would be a royal PITA in COBOL
> or EasyTrieve.

You're welcome.

Frank Yaeger - DFSORT Development Team (IBM) - [email protected]
Specialties: FINDREP, WHEN=GROUP, DATASORT, ICETOOL, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to