validdate question.



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

Re: validdate question.

Postby dick scherrer » Wed Jun 30, 2010 2:34 am

Hello,

Looks like one of the biggest obstacles is communication. . .

Enrico votes for the first one, but Dick for the second
I don't speak for Enrico, but i voted for neither. . . Mine was just a suggestion as to why the values you mentioned were treated as they were. You might run an experiment changing this:
IF    VALIDDATE('2010013 ','YYYYMMDD')                       
THEN PUT SKIP LIST (''''||'2010013 '||''''|| ' IS VALID '); 
ELSE PUT SKIP LIST (''''||'2010013 '||''''|| ' IS NOT   ');
to:
IF    VALIDDATE('2010023 ','YYYYMMDD')                       
THEN PUT SKIP LIST (''''||'2010023 '||''''|| ' IS VALID '); 
ELSE PUT SKIP LIST (''''||'2010023 '||''''|| ' IS NOT   ');

My guess is that this will now be invalid rather than valid (only a guess as i can't test it).

As Enrico mentioned - if you don't like the way it works, open an issue with IBM.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: validdate question.

Postby prino » Wed Jun 30, 2010 3:12 am

dick scherrer wrote:As Enrico mentioned - if you don't like the way it works, open an issue with IBM.


It IS a bug and will be fixed once the customer opens a PMR.

How do I know? Let's just say I know...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 612
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 27 times

Re: validdate question.

Postby enrico-sorichetti » Wed Jun 30, 2010 3:46 am

'2010011 ' IS VALID
'2010012 ' IS VALID
'2010013 ' IS VALID
'2010014 ' IS NOT
'2010021 ' IS VALID
'2010022 ' IS VALID
'2010023 ' IS NOT

tested, Dick guess is the right one
but not because of aligning left or right

additional test
'2010011' IS NOT
'20101 1 ' IS VALID MM = 1b DD = 1b
'20101  1' IS VALID MM = 1b DD = b1
'2010 11 ' IS VALID MM = b1 DD = 1b
'2010 1 1' IS VALID MM = b1 DD = b1



... if you think "3 " matches two-digit day - accept my congratulations...
.. I also have 6400 ideas how it pars chars, but..

apart the communications problems You have also an attitude problem

we try to help and all we get back is Your stupid sarcasm
it would be wiser for You to drop Your 'I am better than thou' attitude

furthermore looks like You have issue with Your testing skills
note the results of the additional tests
You could have found out by Yourself and deduced a reasonable
explanation of VALIDDATE behavior,
but You were so busy contemplating Your 6400 ideas that You missed the obvious 8-)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2943
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 156 times

Re: validdate question.

Postby enrico-sorichetti » Wed Jun 30, 2010 3:53 am

It IS a bug and will be fixed once the customer opens a PMR.
How do I know? Let's just say I know...


Hi Robert!
at least is a bug with some logic

'2    1 1' IS VALID
'201 0101' IS VALID
'2 100101' IS VALID
'20101 1 ' IS VALID
'20101  1' IS VALID
'2010 11 ' IS VALID
'2010 1 1' IS VALID


it translates unconditionally a blank to a zero
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2943
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 156 times

Re: validdate question.

Postby igorkigork » Wed Jun 30, 2010 11:32 am

I did not ask to help,
I asked to confirm that what i found is a bug, for me it is obvious,
experts explained that the problem is not in validdate, but with me...

by the way:
IBM confirmed the issue. PMR opened.

thanks.
igorkigork
 
Posts: 16
Joined: Thu Feb 11, 2010 9:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: validdate question.

Postby BWH3922 » Sat Jul 17, 2010 11:33 am

I think the compiler is working as designed... look at Source to target conversion rules.

"If the source is a null string or a string of one or more blanks, the target will
be assigned the value zero. The CONVERSION condition will not be raised."

BWH
BWH3922
 
Posts: 2
Joined: Fri May 21, 2010 9:26 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post