HP3000-L Archives

October 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Neil Harvey <[log in to unmask]>
Reply To:
Neil Harvey <[log in to unmask]>
Date:
Tue, 20 Oct 1998 13:02:36 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (107 lines)
I use

    MOVE FUNCTION CURRENT-DATE TO WS-DTTM.

where the WS-DTTM structure look like

     03  WS-DTTM.
           05  WS-DT.
              07  WS-DT-CCYY       PIC 9999.
              07  WS-DT-MM         PIC 99.
              07  WS-DT-DD         PIC 99.
          05  WS-DT-N REDEFINES WS-DT PIC 9(8).
          05  WS-TMHMSM.
             06  WS-TMHMS.
              07  WS-TMHH          PIC 99.
              07  WS-TMMM          PIC 99.
              07  WS-TMSS          PIC 99.
              07  WS-TMMS          PIC 99.

Hope this helps.

Oh yes, you need to specify POST85 on the $CONTROL line.

Regards

Neil Harvey



-----Original Message-----
From: David Rutherford [mailto:[log in to unmask]]
Sent: 20 October 1998 11:20
To: [log in to unmask]
Subject: Re: HP Cobol and 4-digit years?


Hello Mark,

As far as I am aware, it will not be possible to simply replace your
existing ACCEPT statements with another ACCEPT statement which will
return the desired 8 digit date - but I could be wrong!

Therefore, I think you will have to look at using an intrinsic, or
writing your own subroutine.

HP have provided several new date related intrinsics (I think from PP4
onwards). You may want to look at the following URL for more
information...

http://jazz.external.hp.com/papers/Communicator/5.5/exp4/cmdate.html
<http://jazz.external.hp.com/papers/Communicator/5.5/exp4/cmdate.html>

..if you use one of the HP intrinsics, you can probably do something
like...


                ACCEPT date-field FROM DATE.
              CALL INTRINSIC "HPDATECONVERT" using lots of parameters...

If all you want to do in ALL cases is to convert the X6(yymmdd) date
returned by ACCEPT to an X8(ccyymmdd) date, you may find it easier to
code your own subroutine. You can get away with just 2 or 3 parameters
this way (one for the input date, one for the output date, one for
status) - lots less typing!

You could even go as far as including the "ACCEPT date FROM DATE" within
the subroutine. Then within your programs you just need to replace your
ACCEPT lines with 'CALL "newsubroutine" using DATE-FIELD, status' - lots
lots less typing. Oh, and don't forget to change your receiving date
fields to X8's.

Many thanks

David
(ex 4321)


        -----Original Message-----
        From:   Mark Gallaher [SMTP:[log in to unmask]]
        Sent:   20 October 1998 03:34
        To:     [log in to unmask]
        Subject:        HP Cobol and 4-digit years?

        * Please Note : This message was received from the Internet *
        _____________________________________________________________

        Hello!

          Can anyone help; I'd like to receive a yyyymmdd-type date from
Cobol.  I
        currently use "accept work-date from date", but of course that
provides only
        the yymmdd-type date.

          Is there another function available from Cobol?  Thanks in
advance.

__________________________________________________________________

                Confidentiality Notice

This message may contain privileged and confidential information. If you
think, for any reason, that this message may have been addressed to you
in error, you must not disseminate, copy or take any action in reliance
on it, and we would ask you to notify us immediately by return email to
"[log in to unmask]".

ATOM RSS1 RSS2