validate YYYYMMDD and HHMMSS
Moderators: chulett, rschirm, roy
validate YYYYMMDD and HHMMSS
Need to validate
if the following formats are correct:
YYYYMMDD
Date:
if isValid ('DATE', StringToDate (StageVar, "% yyyy% mm% dd")) Then StageVar else 0
HHMMSS
Time
isvalid (HH: MM: SS)
Please confirm if it is correct
if the following formats are correct:
YYYYMMDD
Date:
if isValid ('DATE', StringToDate (StageVar, "% yyyy% mm% dd")) Then StageVar else 0
HHMMSS
Time
isvalid (HH: MM: SS)
Please confirm if it is correct
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
IsValid(inLink.TheTimeString, "%hh%nn%ss")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For 8.0.1 (at least according to the manual) and therefore, presumably, for 8.1.
(page 601)Parallel Job Developer's Guide (8.0) wrote:result (int8) = IsValid(type (string) [, format (string)])
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
The 8.1 docs have the same entry (and so do the 7.5.1a docs), but I think it was a typo that never got corrected. It should be (IMHO)
With type being one of the datatypes and string being the value being validated. At least that is what the transformer derivation validator allows.
When I run this derivation:
I get this message and a result of 0:
That's on two different 8.1 FP1 systems, one RedHat and one AIX.
c'est la vie
Code: Select all
result (int8) = IsValid(type (string), string (string))
When I run this derivation:
Code: Select all
IsValid("120101","%hh%nn%ss")
Code: Select all
APT_CombinedOperatorController,1: Expected identifier; got: "120101"
c'est la vie
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
validate
isvalid('DATE',StringToDate(Lnk_campo,"%yyyy%mm%dd"))jwiles wrote:I tried the third option in 8.1 as well and it wouldn't pass validation.
isvalid('TIME',StringToTime(Lnk_encabezado.CHDHTR_E,"%hh%nn%ss"))