INFO ON FOCUS DISCUSSION LIST
               MDY USAGE.
               CHGDATE FAILS.
                Excluding Holidays and Weekends using FOCUS 7.05
                How to use the sliding windows attributes (DFC and YRT)

 FOCUS-L Info

The FOCUS discussion list is an unofficial channel of support. You can subscribe
to it by sending a mail to listproc@lists.indstate.edu
With subscribe focus-l in the body of the message. The mails are also archived at  findmail .
 

MDY Usage

I am puzzled by some code (FOCUS for UNIX 6.8) that is used frequently
in a system of focexecs that I did not write but am now responsible for. It
involves the use of the MDY function:
ELSE IF NOT MDY('010101',&BDT1)
THEN ' MESSAGE: ERROR - BEGIN DATE INVALID'
So I am clueless as to the purpose of the code.
Anyone know what this code is trying to do?
(I am expanding the CRTFORM dates from MMDDYY to MMDDYYYY format.)
REPLY :-
MDY returns the number of days between two dates. It ALSO returns a ZERO if
a date is invalid. So, if MDY returns a zero,the date is invalid. If the
result
of MDY is 0 (treated as a logical FALSE), the 'NOT' reverses that, so that
a MDY of 0 (FALSE) gives a NOT FALSE condition, or TRUE.
In effect, the logic does a date validation on &BDT1.

QUESTION CONTINUES ...
So the '010101' is arbitrary in this usage and I don't need to worry about
it if &BDT1 is going from mmddyy to mmddyyyy?

Well, 010101 is arbitrary, in the sense that ANY valid date would work.
just want one that WON'T be a value for &BDT1 (you'd get a difference of
and would treat it as invalid).

As for going to MDYY format, I don't believe the MDY function handles a
digit input. You can use CHGDAT, which will accept a MDYY format date.
Here's an example:
-PROMPT &VAR
-SET &MSG = IF CHGDAT(MDYY, MDYY, &VAR | 'X', 'A17') EQ ' '
- THEN ' MESSAGE: ERROR - BEGIN DATE INVALID'
- ELSE ' OK DATE';
-TYPE &MSG
Note that we concatenate an 'X' to the end of the input date, to prevent
conversion to double precision. If CHGDAT finds an 'invalid' date, it returns
a 'blank' value, the value for which we test.

Replied By
Art Greenhaus.

There is one hole: MDY also returns 0 when the two dates are equal, so
a value of 010101 (or whatever you use as the constant date) will be
rejected. "IF AYMD(&vardate, +0, 'I6') EQ 0" is better in that regard,
and avoids whatever uncertainty may exist about comparing 6- and 8-digit
date values.

I agree that AYMD would have been better. But, since the original message
said that the incoming date was format MDYY, then AYMD wouldn't work.

CHGDATE FAILS

Has anyone had any problems with CHGDAT in 7.08 MVS.
We are running programs that work fine in 7.05M but not in 7.08 if
chdat is called. Aside from this warning problem, other things run,
so am just concerned about the CHGDAT
I have this statement in a focexec:
DATE1/A6MDY = CHGDAT('YYMD','MDY',CIEQIP_DATE_RECEIVED ,DATE1);
and Focus 7.0.8 produces this error:

> CSV003I REQUESTED MODULE CHGDATI NOT FOUND
ERROR AT OR NEAR LINE 7 IN PROCEDURE CIPCCNTSFOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: (
ERROR AT OR NEAR LINE 22 IN PROCEDURE CIPCCNTSFOCEXEC
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: DATE1
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT
Thanks.
NANCY KRUKOW

Reply By Rob Freeman:- ( IBI )
I can see this happening if you don't have an allocation for the R7.0.8
FUSELIB.LOAD dsn. This dsn contains the new version of chgdat called
chgdati.
The prior releases of FOCUS didn't have the member CHGDATI shipped as part
OF FUSELIB.LOAD. The default setting for Y2K compliance is DATEFNS=ON which
means we will try to load the new version of these subroutines vs. the old.
This is why it's failing on you. An allocation for the R7.0.8 FUSELIB
should solve this problem. Also remember that if you don't want the
Y2K version of the date subroutines you may deactivate them with,
SET DATEFNS=OFF.
You may have problems with all of the subroutines, not only CHGDAT,

The missing suboutine, CHGDATI, is a new entry point to CHGDAT that is
only available in release 7.0.8. This was added as part of our Y2K
solution. Since you are apparently using the 7.0.5 FUSELIB, CHGDATI
dose not exist and cannot be found.

None of our other clients have reported a problem with FUSELIB
distributed on the tape. You may want to double check your
installation, attempt to reload FUSELIB.LOAD from the tape, or call
customer support to assist in the installation or send a new tape.

Rob Freeman

Excluding Holidays and Weekends using FOCUS 7.05

We are currently using mainframe FOCUS 7.05 and we are in need of some help.
Does anyone have a FOCUS program that will exclude Holidays and Weekends?
Any examples would be greatly appreciated!

There were some excellent articles, with code examples, in recent
issues of the Focus Systems Journal. The articles were written by
Allan Doolittle. In the September/October issue (Volume 10, Number 5),
he included a program called Anytime which addressed weekends and
could be modified for holidays. Perhaps IBI can, finally, arrange for
these programs to be made available on their web site. Otherwise, you
can order a back copy.

The IBI System Journal of last October or so included a routine called
"ANYTIME" which will allows you to exclude holidays and/or weekends in a
FOCEXEC TABLE request. It requires you to maintain a file of "holidays" as
your company dictates.
 

Sliding windows attributes (DFC and YRT)

How do I use the sliding windows attributes (DFC and YRT)
in a computed field in MAINTAIN. I tried

todayl/mdyy dfc 19 yrt 90 = today('a8') ;

and got the error message

ERROR AT OR NEAR LINE 5 IN PROCEDURE TSTTD FOCEXEC *
(FOC03681) Syntax Error near column 13.
TODAYL/MDYY DFC 19 yrt 90 = today('a8') ;

This I want to compile the procedure amper variables are out. I wanted to
use DFC and YRT to get around fact that TODAY() function does NOT return a
century date which I need. I wanted to avoid parsing the year out of the
date and then rebuilding it base on year but will if have to.

REPLY : Using DFC and YRT with Compute in Maintain

You are getting an error because the value returned by TODAY includes
the '/'. Try the following:

tempday/a8 = today(tempday);

todayl/mdyy dfc 19 yrt 90 = edit(tempday,'99$99$99') ;
REPLY : Using DFC and YRT with Compute in Maintain

As of release 7.08 of Mainframe Focus, Maintain does still not support
Y2K. There is work being done on it now, and it should be available
soon. If you need to get a century date with the TODAY function, do it
as follows:

Compute Today1/a8=TODAY(TODAY1);
Compute Today2/MDY = Today1;
Compute Today3/Mdyy=Today2;

REPLY : YRT & DEFCENT with MAINTAIN

As of Release 7.0.8 you will receive a warning message saying that YRT
and DFC are not yet supported in MAINTAIN, but your MAINTAIN
application will continue to run without blowing up.

We are in the process of coding this fix and expect to have it
included in Release 7.0.9 due out this summer.

Maria Sanchez
MAINTAIN Product Manager

QUESTION Re: Using DFC and YRT with Compute in Maintain

I was told last week that in 2000, the default value for defcent changes
to 20 from 19. Is this correct? If so, using defcent & yrthresh for
the Today function will become a moot point. Can IBI answer this?
Thanks

REPLY FROM IBI ...

I spoke to a programmer about this. It was a conscious decision NOT to
change DEFCENT at the turn of the century, for upward compatibility
reasons. It was felt that the site COULD set DEFCENT, if that was desired,
but to have FOCUS make the change could have negative effects on
existing applications.
 
     Continue further there are more questions in the  Next page and subsequent pages !