HP3000-L Archives

August 2000, Week 1

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:
Michael Berkowitz <[log in to unmask]>
Reply To:
Michael Berkowitz <[log in to unmask]>
Date:
Mon, 7 Aug 2000 07:50:41 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
David Hancock writes:

-----Original Message-----
From: David Hancock [mailto:[log in to unmask]]
Sent: Sunday, August 06, 2000 8:54 PM
To: [log in to unmask]
Subject: Date validation


I need to validate a date field (user input) in cobol source code.
Does anyone know if there is an HP 3000 function that validates a date.
the date is in the format of CCYYMMDD.

Thanks in advance.
-------------------------------------------------
Easy, just use the HP date intrinsic HPDATEVALIDATE that became available in
5.5 PP5.

01  INPUT-DATE PIC X(8).
01  DATECODE PIC S9(9) COMP VALUE 38.
01  DATE-RESULT PIC S9(9) COMP.

MOVE YOURDATE TO INPUT-DATE.
CALL INTRINSIC "HPDATEVALIDATE"
     USING DATECODE INPUT-DATE
     GIVING DATE-RESULT.

IF DATE-RESULT = 0
    DISPLAY "DATE IS GOOD"
ELSE
    DISPLAY "DATE IS BAD".

Mike Berkowitz
Guess? Inc.

ATOM RSS1 RSS2