[focus-l] Re: Date mess. . .

  • From: "Hamilton, Robert L" <roberth@xxxxxxxxxxxx>
  • To: <focus-l@xxxxxxxxxxxxx>
  • Date: Wed, 8 Jun 2005 14:14:02 -0500

Thnx, for the help;

wEll, for dates and other reasons, had to go back donw to the PC file
and,

For each csv record

  for each field in the record =3D Column_value

        IF  POS('/',Column_value) > 0 then ,  /* a slash means a date
field */
        Do
           parse var Column_value mo'/'day'/'ccyy =20
           Column_value =3D ccyy'/'right(mo,2,'0')'/'right(day,2,'0')','
/* create field =3D ccyy/mm/dd  =09
        End;
   new_record =3D new_record||Column_value   =20
   end
Write new_record;
End

=20

-----Original Message-----
From: focus-l-bounce@xxxxxxxxxxxxx [mailto:focus-l-bounce@xxxxxxxxxxxxx]
On Behalf Of John W Price
Sent: Wednesday, June 08, 2005 1:54 PM
To: focus-l@xxxxxxxxxxxxx
Cc: 'Vivian Perlmutter'
Subject: [focus-l] Re: Date mess. . .

Bob,
I know you have come up with you own solution, but this variation should
be one of the most compact.

FILEDEF TEST DISK TEST.DAT
DEFINE FILE TEST
-* only four variations can occur X/X/XXXX, X/XX/XXXX XX/X/XXXX,
XX/XX/XXXX ALPH_DATE/A8YYMD =3D IF EDIT(DATEMDY,'$9$9') EQ '//'
                      THEN EDIT(DATEMDY,'09$09$9999')
              ELSE IF EDIT(DATEMDY,'$9$$9') EQ '//'
                      THEN EDIT(DATEMDY,'09$99$9999')
              ELSE IF EDIT(DATEMDY,'$$9$9') EQ '//'
                      THEN EDIT(DATEMDY,'99$09$9999')
              ELSE EDIT(DATEMDY,'99$99$9999') ;
-* change all the spaces to zeros - decimal values (32 & 48) are for
ASCII
-* for EBCDIC use 64 and 240 (hex 40 and F0 for those who speak hex)
ALPH_DATE/A8MDYY =3D CTRAN(8,ALPH_DATE,32,48,'A8') ; SD_DATE/YYMD =3D
ALPH_DATE ; END

Like most things in FOCUS there are always multiple solutions.

John Price
=20

-----Original Message-----
From: focus-l-bounce@xxxxxxxxxxxxx [mailto:focus-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Hamilton, Robert L
Sent: Tuesday, June 07, 2005 7:22 AM
To: focus-l@xxxxxxxxxxxxx
Subject: [focus-l] Date mess. . .

We get dates from the government with a mish-mash of date formats and
this one has me stumped
=20
?m/xd/ccyy
=20
where ? can be blank or null or 0 or 1  AND x can be blank, null,
zero,1,2, or 3.
=20
examples
=20
8/3/2004
8/ 3/2004
 8/03/2004
=20
et al.
=20
I need it sortable as in  ccyymmdd.  The string has many other fields;
it's csv in the PC world so I could go thru with objrexx and unstring
the thing before up loading to z/OS  but a FOCUS solution would be
helpful. . .
=20
thnx
=20
bobh





Other related posts: