-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTempUpcomingJobs
803 lines (687 loc) · 54.2 KB
/
TempUpcomingJobs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
-SET &ECHO = 'OFF';
-DEFAULT &SearchString = 'ALL';
-DEFAULT &RangeStart = '&DATEMDYY.EVAL';
-DEFAULT &RangeEnd = '&DATEMDYY.EVAL';
-DEFAULT &LastRunStatus = '_FOC_NULL';
-DEFAULT &IntervalType = '_FOC_NULL';
-DEFAULT &Details = 'N';
-DEFAULT &Parameters = 'N';
-DEFAULT &WFFMT = 'HTML';
-PROMPT &SearchString.Enter search string (not case sensitive).;
-PROMPT &RangeStart.(|FORMAT=MDYY).Runs on or after.;
-PROMPT &RangeEnd.(|FORMAT=MDYY).Runs on or before.;
-PROMPT &LastRunStatus.(<All,_FOC_NULL>,<Failed,FAILURE>,<Warning,WARNING>,<No Errors,NOERROR>).Last Run Status.;
-PROMPT &IntervalType.(<All,_FOC_NULL>,<Custom,C>,<Daily,D>,<Weekly,W>,<Monthly,M>,<Yearly,Y>).Run Interval.;
-PROMPT &Details.(<No,N>,<Yes,Y>).Show Packet and Task Names?.;
-PROMPT &Parameters.(<No,N>,<Yes,Y>).Show Parameters?.;
-PROMPT &WFFMT.(<Online,HTML>,<Spreadsheet,XLSX>).Output Format.;
-* date logic for parameters
-SET &RangeDays = DATEDIF('&RangeStart.EVAL', '&RangeEnd.EVAL', 'D') + 1;
-SET &RangeMonths = DATEDIF('&RangeStart.EVAL', '&RangeEnd.EVAL', 'M') + 1;
-SET &RangeYears = DATEDIF('&RangeStart.EVAL', '&RangeEnd.EVAL', 'Y') + 1;
-* logic for start dates
-SET &RangeStart_MtrDY = STRREP(&RangeStart.LENGTH, '&RangeStart.EVAL', 1, ',', 0, '', &RangeStart.LENGTH, 'A&RangeStart.LENGTH');
-SET &RangeEnd_MtrDY = STRREP(&RangeEnd.LENGTH, '&RangeEnd.EVAL', 1, ',', 0, '', &RangeEnd.LENGTH, 'A&RangeEnd.LENGTH');
-SET &IPOS1 = POSIT('&RangeStart_MtrDY.EVAL', &RangeStart_MtrDY.LENGTH, ' ', 1, 'I3');
-SET &RangeStart_Mtr = SUBSTR(&RangeStart_MtrDY.LENGTH, '&RangeStart_MtrDY.EVAL', 1, &IPOS1-1, &IPOS1, 'A20');
-SET &STRIP1 = SUBSTR(&RangeStart_MtrDY.LENGTH, '&RangeStart_MtrDY.EVAL', &IPOS1+1, &RangeStart_MtrDY.LENGTH, &RangeStart_MtrDY.LENGTH-&IPOS1, 'A&RangeStart_MtrDY.LENGTH');
-SET &IPOS2 = POSIT('&STRIP1.EVAL', &STRIP1.LENGTH, ' ', 1, 'I3');
-SET &RangeStart_DD = SUBSTR(&STRIP1.LENGTH, '&STRIP1.EVAL', 1, &IPOS2-1, &IPOS2, 'A20');
-SET &STRIP2 = SUBSTR(&STRIP1.LENGTH, '&STRIP1.EVAL', &IPOS2+1, &STRIP1.LENGTH, &STRIP1.LENGTH-&IPOS2, 'A&STRIP1.LENGTH');
-SET &RangeStart_YY = SUBSTR(&STRIP2.LENGTH, '&STRIP2.EVAL', 1, 4, 4, 'A4');
-SET &RangeStart_MM = IF '&RangeStart_Mtr.EVAL' CONTAINS 'Jan' THEN '01' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Feb' THEN '02' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Mar' THEN '03' ELSE
- IF '&RangeStart_Mtr.EVAL' CONTAINS 'Apr' THEN '04' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'May' THEN '05' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Jun' THEN '06' ELSE
- IF '&RangeStart_Mtr.EVAL' CONTAINS 'Jul' THEN '07' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Aug' THEN '08' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Sep' THEN '09' ELSE
- IF '&RangeStart_Mtr.EVAL' CONTAINS 'Oct' THEN '10' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Nov' THEN '11' ELSE IF '&RangeStart_Mtr.EVAL' CONTAINS 'Dec' THEN '12' ELSE '99';
-SET &RangeStart_DD = IF &RangeStart_DD LE 9 THEN '0' || &RangeStart_DD ELSE &RangeStart_DD;
-SET &RangeStart_YYMD = &RangeStart_YY || &RangeStart_MM || &RangeStart_DD;
-SET &RangeStart_BOM_YYMD = &RangeStart_YY || &RangeStart_MM || '01';
-SET &RangeStart_BOM_DOW = DOWK(&RangeStart_BOM_YYMD, 'A4');
-SET &RangeStart_BOM_Offset = DATECVT(&RangeStart_BOM_YYMD,'I8YYMD', 'YYMD');
-SET &RangeStart_EOM_Offset = DATEMOV(&RangeStart_BOM_Offset, 'EOM');
-SET &RangeStart_EOM_YYMD = DATECVT(&RangeStart_EOM_Offset,'YYMD','A8YYMD');
-SET &RangeStart_EOM_DOW = DOWK(&RangeStart_EOM_YYMD, 'A4');
-* logic for end dates
-SET &IPOS1 = POSIT('&RangeEnd_MtrDY.EVAL', &RangeEnd_MtrDY.LENGTH, ' ', 1, 'I3');
-SET &RangeEnd_Mtr = SUBSTR(&RangeEnd_MtrDY.LENGTH, '&RangeEnd_MtrDY.EVAL', 1, &IPOS1-1, &IPOS1, 'A20');
-SET &STRIP1 = SUBSTR(&RangeEnd_MtrDY.LENGTH, '&RangeEnd_MtrDY.EVAL', &IPOS1+1, &RangeEnd_MtrDY.LENGTH, &RangeEnd_MtrDY.LENGTH-&IPOS1, 'A&RangeEnd_MtrDY.LENGTH');
-SET &IPOS2 = POSIT('&STRIP1.EVAL', &STRIP1.LENGTH, ' ', 1, 'I3');
-SET &RangeEnd_DD = SUBSTR(&STRIP1.LENGTH, '&STRIP1.EVAL', 1, &IPOS2-1, &IPOS2, 'A20');
-SET &RangeEnd_DD = IF &RangeEnd_DD LE 9 THEN '0' || &RangeEnd_DD ELSE &RangeEnd_DD;
-SET &STRIP2 = SUBSTR(&STRIP1.LENGTH, '&STRIP1.EVAL', &IPOS2+1, &STRIP1.LENGTH, &STRIP1.LENGTH-&IPOS2, 'A&STRIP1.LENGTH');
-SET &RangeEnd_YY = SUBSTR(&STRIP2.LENGTH, '&STRIP2.EVAL', 1, 4, 4, 'A4');
-SET &RangeEnd_MM = IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Jan' THEN '01' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Feb' THEN '02' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Mar' THEN '03' ELSE
- IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Apr' THEN '04' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'May' THEN '05' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Jun' THEN '06' ELSE
- IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Jul' THEN '07' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Aug' THEN '08' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Sep' THEN '09' ELSE
- IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Oct' THEN '10' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Nov' THEN '11' ELSE IF '&RangeEnd_Mtr.EVAL' CONTAINS 'Dec' THEN '12' ELSE '99';
-SET &RangeEnd_YYMD = &RangeEnd_YY || &RangeEnd_MM || &RangeEnd_DD;
-SET &RangeEnd_BOM_YYMD = &RangeEnd_YY || &RangeEnd_MM || '01';
-SET &RangeEnd_BOM_DOW = DOWK(&RangeStart_BOM_YYMD, 'A4');
-* date functions like DATEMOV and DATEADD need offset, not the string, so use DATECVT to make offset values
-SET &RangeEnd_BOM_Offset = DATECVT(&RangeEnd_BOM_YYMD,'I8YYMD', 'YYMD');
-SET &RangeEnd_EOM_Offset = DATEMOV(&RangeEnd_BOM_Offset, 'EOM');
-SET &RangeEnd_EOM_YYMD = DATECVT(&RangeEnd_EOM_Offset,'YYMD','A8YYMD');
-SET &RangeEnd_EOM_DOW = DOWK(&RangeEnd_EOM_YYMD, 'A4');
-SET &RangeSameMonth = IF &RangeStart_BOM_YYMD IS &RangeEnd_BOM_YYMD THEN 'Y' ELSE 'N';
-TYPE RangeStart=&RangeStart
-TYPE RangeStart_MtrDY=&RangeStart_MtrDY
-TYPE RangeStart_Mtr=&RangeStart_Mtr
-TYPE RangeStart_YYMD=&RangeStart_YYMD
-TYPE RangeStart_BOM_YYMD=&RangeStart_BOM_YYMD
-TYPE RangeStart_BOM_DOW=&RangeStart_BOM_DOW
-TYPE RangeEnd=&RangeEnd
-TYPE RangeEnd_MtrDY=&RangeEnd_MtrDY
-TYPE RangeEnd_MtrDY=&RangeEnd_MtrDY
-TYPE RangeEnd_YYMD=&RangeEnd_YYMD
-TYPE RangeEnd_BOM_YYMD=&RangeEnd_BOM_YYMD
-TYPE RangeEnd_BOM_DOW=&RangeEnd_BOM_DOW
-TYPE RangeEnd_EOM_YYMD=&RangeEnd_EOM_YYMD
-TYPE RangeEnd_EOM_DOW=&RangeEnd_EOM_DOW
-TYPE RangeSameMonth=&RangeSameMonth
-* Using MON=1
-SET &DOW = &RangeStart_BOM_DOW ;
-SET &RangeStart_BOM_DOWNBR = IF &DOW IS 'MON' THEN 1 ELSE IF &DOW IS 'TUE' THEN 2 ELSE IF &DOW IS 'WED' THEN 3 ELSE IF &DOW IS 'THU' THEN 4 ELSE
- IF &DOW IS 'FRI' THEN 5 ELSE IF &DOW IS 'SAT' THEN 6 ELSE IF &DOW IS 'SUN' THEN 7 ELSE 9;
-* get day sequence of 1st week of start range month
-SET &NEXT0 = &RangeStart_BOM_DOWNBR;
-SET &NEXT1 = IF &NEXT0 IS 7 THEN 1 ELSE &NEXT0 + 1;
-SET &NEXT2 = IF &NEXT1 IS 7 THEN 1 ELSE &NEXT1 + 1;
-SET &NEXT3 = IF &NEXT2 IS 7 THEN 1 ELSE &NEXT2 + 1;
-SET &NEXT4 = IF &NEXT3 IS 7 THEN 1 ELSE &NEXT3 + 1;
-SET &NEXT5 = IF &NEXT4 IS 7 THEN 1 ELSE &NEXT4 + 1;
-SET &NEXT6 = IF &NEXT5 IS 7 THEN 1 ELSE &NEXT5 + 1;
-SET &RangeStart_WeekDay_Sequence = &NEXT0 || &NEXT1 || &NEXT2 || &NEXT3 || &NEXT4 || &NEXT5 || &NEXT6;
DEFINE FUNCTION CALCDATE(USEDATE/I8YYMD, USEDOW/I1, NEXT0/I1, NEXT1/I1, NEXT2/I1, NEXT3/I1, NEXT4/I1, NEXT5/I1, NEXT6/I1)
CALCDATE/I8YYMD = IF NEXT0 IS USEDOW THEN USEDATE+0 ELSE IF NEXT1 IS USEDOW THEN USEDATE+1 ELSE IF NEXT2 IS USEDOW THEN USEDATE+2 ELSE IF NEXT3 IS USEDOW THEN USEDATE+3 ELSE
IF NEXT4 IS USEDOW THEN USEDATE+4 ELSE IF NEXT5 IS USEDOW THEN USEDATE+5 ELSE IF NEXT6 IS USEDOW THEN USEDATE+6 ELSE 99999999;
END
-RUN
-SET &USEDATE = &RangeStart_BOM_YYMD;
-SET &FIRSTMON = CALCDATE(&USEDATE, 1, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTTUE = CALCDATE(&USEDATE, 2, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTWED = CALCDATE(&USEDATE, 3, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTTHU = CALCDATE(&USEDATE, 4, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTFRI = CALCDATE(&USEDATE, 5, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTSAT = CALCDATE(&USEDATE, 6, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &FIRSTSUN = CALCDATE(&USEDATE, 7, &NEXT0, &NEXT1, &NEXT2, &NEXT3, &NEXT4, &NEXT5, &NEXT6);
-SET &SECONDMON = &FIRSTMON + 7;
-SET &SECONDTUE = &FIRSTTUE + 7;
-SET &SECONDWED = &FIRSTWED + 7;
-SET &SECONDTHU = &FIRSTTHU + 7;
-SET &SECONDFRI = &FIRSTFRI + 7;
-SET &SECONDSAT = &FIRSTSAT + 7;
-SET &SECONDSUN = &FIRSTSUN + 7;
-SET &THIRDMON = &FIRSTMON + 14;
-SET &THIRDTUE = &FIRSTTUE + 14;
-SET &THIRDWED = &FIRSTWED + 14;
-SET &THIRDTHU = &FIRSTTHU + 14;
-SET &THIRDFRI = &FIRSTFRI + 14;
-SET &THIRDSAT = &FIRSTSAT + 14;
-SET &THIRDSUN = &FIRSTSUN + 14;
-SET &FOURTHMON = &FIRSTMON + 21;
-SET &FOURTHTUE = &FIRSTTUE + 21;
-SET &FOURTHWED = &FIRSTWED + 21;
-SET &FOURTHTHU = &FIRSTTHU + 21;
-SET &FOURTHFRI = &FIRSTFRI + 21;
-SET &FOURTHSAT = &FIRSTSAT + 21;
-SET &FOURTHSUN = &FIRSTSUN + 21;
-TYPE Figure out first/second/third/fourth week days of month
-TYPE .. Start of Range BOM YYMD is &RangeStart_BOM_YYMD
-TYPE .. Start of Range BOM DOW is &RangeStart_BOM_DOW (DayNbr=&RangeStart_BOM_DOWNBR)
-TYPE .. Start of Range Week Day Sequence is &RangeStart_WeekDay_Sequence
-TYPE .....First Monday is on &FIRSTMON / 2nd=&SECONDMON / 3rd=&THIRDMON / 4th=&FOURTHMON
-TYPE .....First Tuesday is on &FIRSTTUE / 2nd=&SECONDTUE / 3rd=&THIRDTUE / 4th=&FOURTHTUE
-TYPE .....First Wednesday is on &FIRSTWED / 2nd=&SECONDWED / 3rd=&THIRDWED / 4th=&FOURTHWED
-TYPE .....First Thursday is on &FIRSTTHU / 2nd=&SECONDTHU / 3rd=&THIRDTHU / 4th=&FOURTHTHU
-TYPE .....First Friday is on &FIRSTFRI / 2nd=&SECONDFRI / 3rd=&THIRDFRI / 4th=&FOURTHFRI
-TYPE .....First Saturday is on &FIRSTSAT / 2nd=&SECONDSAT / 3rd=&THIRDSAT / 4th=&FOURTHSAT
-TYPE .....First Sunday is on &FIRSTSUN / 2nd=&SECONDSUN / 3rd=&THIRDSUN / 4th=&FOURTHSUN
-* Using MON=1
-SET &DOW = &RangeStart_EOM_DOW ;
-SET &DOWNBR = IF &DOW IS 'MON' THEN 1 ELSE IF &DOW IS 'TUE' THEN 2 ELSE IF &DOW IS 'WED' THEN 3 ELSE IF &DOW IS 'THU' THEN 4 ELSE
- IF &DOW IS 'FRI' THEN 5 ELSE IF &DOW IS 'SAT' THEN 6 ELSE IF &DOW IS 'SUN' THEN 7 ELSE 9;
-SET &RangeStart_EOM_DOWNBR = &DOWNBR;
-* get day sequence of last week of start range month
-SET &NEXT0 = &RangeStart_EOM_DOWNBR;
-SET &NEXT1 = IF &NEXT0 IS 1 THEN 7 ELSE &NEXT0-1;
-SET &NEXT2 = IF &NEXT1 IS 1 THEN 7 ELSE &NEXT1-1;
-SET &NEXT3 = IF &NEXT2 IS 1 THEN 7 ELSE &NEXT2-1;
-SET &NEXT4 = IF &NEXT3 IS 1 THEN 7 ELSE &NEXT3-1;
-SET &NEXT5 = IF &NEXT4 IS 1 THEN 7 ELSE &NEXT4-1;
-SET &NEXT6 = IF &NEXT5 IS 1 THEN 7 ELSE &NEXT5-1;
-SET &RangeStart_LastWeekDay_Sequence = &NEXT6 || &NEXT5 || &NEXT4 || &NEXT3 || &NEXT2 || &NEXT1 || &NEXT0;
-SET &USEDATE = &RangeStart_EOM_YYMD-6;
-SET &LASTMON = CALCDATE(&USEDATE, 1, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTTUE = CALCDATE(&USEDATE, 2, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTWED = CALCDATE(&USEDATE, 3, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTTHU = CALCDATE(&USEDATE, 4, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTFRI = CALCDATE(&USEDATE, 5, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTSAT = CALCDATE(&USEDATE, 6, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-SET &LASTSUN = CALCDATE(&USEDATE, 7, &NEXT6, &NEXT5, &NEXT4, &NEXT3, &NEXT2, &NEXT1, &NEXT0);
-TYPE Figure out last week days of month
-TYPE .. Start of Range EOM YYMD is &RangeStart_EOM_YYMD
-TYPE .. Start of Range EOM DOW is &RangeStart_EOM_DOW (DayNbr=&RangeStart_EOM_DOWNBR)
-TYPE .. Start of Range Last Week Day Sequence is &RangeStart_LastWeekDay_Sequence
-TYPE .....Last Monday is &LASTMON
-TYPE .....Last Tuesday is &LASTTUE
-TYPE .....Last Wednesday is &LASTWED
-TYPE .....Last Thursday is &LASTTHU
-TYPE .....Last Friday is &LASTFRI
-TYPE .....Last Saturday is &LASTSAT
-TYPE .....Last Sunday is &LASTSUN
-SET &SearchString = IF '&SearchString.EVAL' IS '' OR 'ALL' OR 'all' OR 'All' THEN '_FOC_NULL' ELSE '&SearchString.EVAL';
-SET &SearchStringDesc = IF '&SearchString.EVAL' IS '_FOC_NULL' THEN '' ELSE 'with names or descriptions containing ' | ('''' || '&SearchString.EVAL' || '''') || ' (not case sensitive)';
-SET &UPSEARCH = UPCASE(&SearchString.LENGTH, '&SearchString.EVAL', 'A&SearchString.LENGTH');
-SET &UPSEARCH2 = STRREP(&UPSEARCH.LENGTH, '&UPSEARCH.EVAL', 1, ' ', 1, '_', &UPSEARCH.LENGTH, 'A&UPSEARCH.LENGTH');
-TYPE UPSEARCH="&UPSEARCH.EVAL"
-SET &BYDISPLAY = IF &WFFMT IS 'HTML' THEN 'OFF' ELSE 'ON';
-SET &IntervalTypeDesc = IF '&IntervalType.EVAL' IS 'O' THEN 'On-Demand' ELSE IF '&IntervalType.EVAL' IS 'W' THEN 'Weekly' ELSE
- IF '&IntervalType.EVAL' IS 'D' THEN 'Daily' ELSE
- IF '&IntervalType.EVAL' IS 'M' THEN 'Monthly' ELSE
- IF '&IntervalType.EVAL' IS 'C' THEN 'Custom' ELSE
- IF '&IntervalType.EVAL' IS 'Y' THEN 'Yearly' ELSE
- IF '&IntervalType.EVAL' IS '_FOC_NULL' THEN 'All' ELSE 'Unknown';
-SET &LastRunStatusDesc = IF '&LastRunStatus.EVAL' IS '_FOC_NULL' THEN 'All' ELSE IF '&LastRunStatus.EVAL' IS 'NOERROR' THEN 'No Errors' ELSE
- IF '&LastRunStatus.EVAL' IS 'FAILURE' THEN 'Failed' ELSE IF '&LastRunStatus.EVAL' IS 'WARNING' THEN 'Warning' ELSE 'Unknown';
JOIN SCHEDULEID IN BOTSCHED TO SCHEDULEID IN BOTSIT AS J1
JOIN PACKETID IN BOTSCHED TO PACKETID IN BOTTASK AS J2
JOIN LEFT_OUTER PACKETID IN BOTSCHED TO PACKETID IN BOTPACK AS J3
JOIN LEFT_OUTER CUSTOMID IN BOTSCHED TO CUSTOMID IN BOTSCIT AS J4
JOIN LEFT_OUTER CUSTOMID IN BOTSCHED TO CUSTOMID IN BOTCDATE AS J5
JOIN LEFT_OUTER SCHEDULEID AND TASKID IN BOTSCHED TO PARAM_SCHED AND TASKID IN BOTPARMS AS J6
DEFINE FILE BOTSCHED
ENDDATE_A8YYMD/A8YYMD = ENDDATE;
ENDDATE_YYMD/YYMD = ENDDATE_A8YYMD;
STARTDATE_A8YYMD/A8YYMD = STARTDATE;
STARTDATE_YYMD/A8YYMD = STARTDATE;
ENDTIME_FMTD/A5 = EDIT(ENDTIME,'99:99');
STARTTIME_FMTD/A5 = EDIT(STARTTIME,'99:99');
INTERVALDESC/A10 = DECODE INTERVALTYPE('O' 'On-Demand' 'W' 'Weekly' 'D' 'Daily' 'M' 'Monthly' 'C' 'Custom' 'Y' 'Yearly' ELSE 'Unknown');
MON/A1 = EDIT(WEEKDAYS,'9$$$$$$');
TUE/A1 = EDIT(WEEKDAYS,'$9$$$$$');
WED/A1 = EDIT(WEEKDAYS,'$$9$$$$');
THU/A1 = EDIT(WEEKDAYS,'$$$9$$$');
FRI/A1 = EDIT(WEEKDAYS,'$$$$9$$');
SAT/A1 = EDIT(WEEKDAYS,'$$$$$9$');
SUN/A1 = EDIT(WEEKDAYS,'$$$$$$9');
ANYDOW/A1 = IF WEEKDAYS IS '1111111' THEN 'Y' ELSE 'N';
WEEKDAYS_RUN/A20 = IF INTERVALTYPE IS 'O' THEN 'Run by User' ELSE IF INTERVALTYPE IS 'C' THEN 'Custom Interval' ELSE IF MON IS '1' THEN 'Mo' ELSE ' ';
WEEKDAYS_RUN/A20 = IF TUE IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'Tu' ELSE IF TUE IS '1' THEN WEEKDAYS_RUN || ',Tu' ELSE WEEKDAYS_RUN;
WEEKDAYS_RUN/A20 = IF WED IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'We' ELSE IF WED IS '1' THEN WEEKDAYS_RUN || ',We' ELSE WEEKDAYS_RUN;
WEEKDAYS_RUN/A20 = IF THU IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'Th' ELSE IF THU IS '1' THEN WEEKDAYS_RUN || ',Th' ELSE WEEKDAYS_RUN;
WEEKDAYS_RUN/A20 = IF FRI IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'Fr' ELSE IF FRI IS '1' THEN WEEKDAYS_RUN || ',Fr' ELSE WEEKDAYS_RUN;
WEEKDAYS_RUN/A20 = IF SAT IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'Sa' ELSE IF SAT IS '1' THEN WEEKDAYS_RUN || ',Sa' ELSE WEEKDAYS_RUN;
WEEKDAYS_RUN/A20 = IF SUN IS '1' AND WEEKDAYS_RUN IS ' ' THEN 'Su' ELSE IF SUN IS '1' THEN WEEKDAYS_RUN || ',Su' ELSE WEEKDAYS_RUN;
RUNS_MON/A1 = IF MON IS '1' THEN 'Y' ELSE 'N';
RUNS_TUE/A1 = IF TUE IS '1' THEN 'Y' ELSE 'N';
RUNS_WED/A1 = IF WED IS '1' THEN 'Y' ELSE 'N';
RUNS_THU/A1 = IF THU IS '1' THEN 'Y' ELSE 'N';
RUNS_FRI/A1 = IF FRI IS '1' THEN 'Y' ELSE 'N';
RUNS_SAT/A1 = IF SAT IS '1' THEN 'Y' ELSE 'N';
RUNS_SUN/A1 = IF SUN IS '1' THEN 'Y' ELSE 'N';
MON_LITERAL/A3 = 'MON';
TUE_LITERAL/A3 = 'TUE';
WED_LITERAL/A3 = 'WED';
THU_LITERAL/A3 = 'THU';
FRI_LITERAL/A3 = 'FRI';
SAT_LITERAL/A3 = 'SAT';
SUN_LITERAL/A3 = 'SUN';
JOBDESC_A/A64 = JOBDESC;
PACKETNAME_A/A64 = DESC1;
TASKNAME_A/A64 = TASKNAME;
UPJOBDESC/A64 = UPCASE(64, JOBDESC_A, UPJOBDESC);
UPPACKETNAME/A64 = UPCASE(64, PACKETNAME_A, UPPACKETNAME);
UPTASKNAME/A64 = UPCASE(64, TASKNAME_A, UPTASKNAME);
NUM_NEXTRUNTIME/D14 WITH NEXTRUNTIME = EDIT(NEXTRUNTIME) ;
START_DATE/I8YYMD WITH NEXTRUNTIME = 19700101;
START_YYMD/YYMD=START_DATE;
SCHEDULE_START/HYYMDIA = HDTTM(START_YYMD, 8, 'HYYMDIA');
NEXT_RUNTIME/HYYMDIA MISSING ON = IF ACTIVE IS 'N' THEN MISSING ELSE IF NUM_NEXTRUNTIME IS 9223372036854775807 THEN MISSING ELSE HADD(SCHEDULE_START,'MILLISECONDS', NUM_NEXTRUNTIME, 8, 'HYYMDIA');
NEXT_RUNTIME/HYYMDIA MISSING ON = HADD(NEXT_RUNTIME, 'HOURS', -5, 8, 'HYYMDIA');
LAST_RUNTIME/YYMD MISSING ON = LASTEXTIME;
REALLYACTIVE/A1 = IF (ACTIVE IS 'Y' AND LASTEXSTATUS IS 'FAILURE') THEN 'N' ELSE
IF (INTERVALTYPE IS 'O' AND ACTIVE IS 'Y' AND LAST_RUNTIME IS MISSING) THEN 'N' ELSE
IF (INTERVALTYPE IS 'O' AND ACTIVE IS 'Y' AND LAST_RUNTIME LT '&DATEYY.EVAL') THEN 'N' ELSE
IF (INTERVALTYPE NE 'O' AND ACTIVE IS 'Y' AND NEXT_RUNTIME IS MISSING) THEN 'N' ELSE 'Y';
PARM_STARTDATE/YYMD = '&RangeStart.EVAL';
PARM_ENDDATE/YYMD = '&RangeEnd.EVAL';
PARM_STARTDATE_I8YYMD/I8YYMD = PARM_STARTDATE;
PARM_STARTDATE_A8YYMD/A8YYMD = EDIT(PARM_STARTDATE_I8YYMD);
PARM_STARTDATE_YEAR/A4 = EDIT(PARM_STARTDATE_A8YYMD, '9999');
PARM_STARTDATE_MONTH/A2 = EDIT(PARM_STARTDATE_A8YYMD,'$$$$99');
PARM_STARTDATE_DOW/A4 = DOWK(PARM_STARTDATE_I8YYMD, PARM_STARTDATE_DOW);
PARM_STARTDATE_DAY/I2 = DTPART(PARM_STARTDATE, DAY);
PARM_STARTDATE_EOM/YYMD = DATEMOV(PARM_STARTDATE,'EOM');
PARM_ENDDATE_I8YYMD/I8YYMD = PARM_ENDDATE;
PARM_ENDDATE_A8YYMD/A8YYMD = EDIT(PARM_ENDDATE_I8YYMD);
PARM_ENDDATE_YEAR/A4 = EDIT(PARM_ENDDATE_A8YYMD, '9999');
PARM_ENDDATE_MONTH/A2 = EDIT(PARM_ENDDATE_A8YYMD,'$$$$99');
PARM_ENDDATE_DOW/A4 = DOWK(PARM_ENDDATE_I8YYMD, PARM_ENDDATE_DOW);
PARM_ENDDATE_DAY/I2 = DTPART(PARM_ENDDATE, DAY);
PARM_RANGE_HAS_EOM/A1 = IF PARM_STARTDATE_EOM FROM PARM_STARTDATE TO PARM_ENDDATE THEN 'Y' ELSE 'N';
PARM_RANGE_SPANS_MONTH/A1 = IF PARM_STARTDATE_MONTH NE PARM_ENDDATE_MONTH THEN 'Y' ELSE 'N';
NEXT_RUNDATE/YYMD = NEXT_RUNTIME;
MONTHRUN_TYPE/A4 = IF EDIT(DATES,'9') IS 'A' THEN 'DOW' ELSE 'DAY#';
DATES_FIRST2/A2 = EDIT(DATES,'99');
MONTHRUN_FREQ/A10 = DECODE DATES_FIRST2 ('A1' '1st' 'A2' '2nd' 'A3' '3rd' 'A4' '4th' 'A5' 'Last' ELSE '');
DAY01/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,01,01,01,'A1') ELSE '';
DAY02/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,02,02,01,'A1') ELSE '';
DAY03/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,03,03,01,'A1') ELSE '';
DAY04/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,04,04,01,'A1') ELSE '';
DAY05/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,05,05,01,'A1') ELSE '';
DAY06/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,06,06,01,'A1') ELSE '';
DAY07/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,07,07,01,'A1') ELSE '';
DAY08/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,08,08,01,'A1') ELSE '';
DAY09/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,09,09,01,'A1') ELSE '';
DAY10/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,10,10,01,'A1') ELSE '';
DAY11/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,11,11,01,'A1') ELSE '';
DAY12/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,12,12,01,'A1') ELSE '';
DAY13/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,13,13,01,'A1') ELSE '';
DAY14/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,14,14,01,'A1') ELSE '';
DAY15/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,15,15,01,'A1') ELSE '';
DAY16/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,16,16,01,'A1') ELSE '';
DAY17/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,17,17,01,'A1') ELSE '';
DAY18/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,18,18,01,'A1') ELSE '';
DAY19/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,19,19,01,'A1') ELSE '';
DAY20/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,20,20,01,'A1') ELSE '';
DAY21/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,21,21,01,'A1') ELSE '';
DAY22/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,22,22,01,'A1') ELSE '';
DAY23/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,23,23,01,'A1') ELSE '';
DAY24/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,24,24,01,'A1') ELSE '';
DAY25/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,25,25,01,'A1') ELSE '';
DAY26/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,26,26,01,'A1') ELSE '';
DAY27/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,27,27,01,'A1') ELSE '';
DAY28/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,28,28,01,'A1') ELSE '';
DAY29/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,29,29,01,'A1') ELSE '';
DAY30/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,30,30,01,'A1') ELSE '';
DAY31/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,31,31,01,'A1') ELSE '';
DAY32/A1 = IF INTERVALTYPE IS 'M' THEN SUBSTR(32,DATES,32,32,01,'A1') ELSE '';
DAY01I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY01) ELSE 0;
DAY02I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY02) ELSE 0;
DAY03I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY03) ELSE 0;
DAY04I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY04) ELSE 0;
DAY05I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY05) ELSE 0;
DAY06I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY06) ELSE 0;
DAY07I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY07) ELSE 0;
DAY08I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY08) ELSE 0;
DAY09I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY09) ELSE 0;
DAY10I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY10) ELSE 0;
DAY11I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY11) ELSE 0;
DAY12I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY12) ELSE 0;
DAY13I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY13) ELSE 0;
DAY14I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY14) ELSE 0;
DAY15I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY15) ELSE 0;
DAY16I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY16) ELSE 0;
DAY17I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY17) ELSE 0;
DAY18I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY18) ELSE 0;
DAY19I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY19) ELSE 0;
DAY20I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY20) ELSE 0;
DAY21I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY21) ELSE 0;
DAY22I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY22) ELSE 0;
DAY23I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY23) ELSE 0;
DAY24I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY24) ELSE 0;
DAY25I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY25) ELSE 0;
DAY26I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY26) ELSE 0;
DAY27I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY27) ELSE 0;
DAY28I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY28) ELSE 0;
DAY29I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY29) ELSE 0;
DAY30I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY30) ELSE 0;
DAY31I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY31) ELSE 0;
DAY32I/I1 = IF INTERVALTYPE IS 'M' THEN EDIT(DAY32) ELSE 0;
DAY01Desc/A4 = IF DAY01I IS 1 THEN '#01' ELSE '';
DAY02Desc/A4 = IF DAY02I IS 1 THEN '#02' ELSE '';
DAY03Desc/A4 = IF DAY03I IS 1 THEN '#03' ELSE '';
DAY04Desc/A4 = IF DAY04I IS 1 THEN '#04' ELSE '';
DAY05Desc/A4 = IF DAY05I IS 1 THEN '#05' ELSE '';
DAY06Desc/A4 = IF DAY06I IS 1 THEN '#06' ELSE '';
DAY07Desc/A4 = IF DAY07I IS 1 THEN '#07' ELSE '';
DAY08Desc/A4 = IF DAY08I IS 1 THEN '#08' ELSE '';
DAY09Desc/A4 = IF DAY09I IS 1 THEN '#09' ELSE '';
DAY10Desc/A4 = IF DAY10I IS 1 THEN '#10' ELSE '';
DAY11Desc/A4 = IF DAY11I IS 1 THEN '#11' ELSE '';
DAY12Desc/A4 = IF DAY12I IS 1 THEN '#12' ELSE '';
DAY13Desc/A4 = IF DAY13I IS 1 THEN '#13' ELSE '';
DAY14Desc/A4 = IF DAY14I IS 1 THEN '#14' ELSE '';
DAY15Desc/A4 = IF DAY15I IS 1 THEN '#15' ELSE '';
DAY16Desc/A4 = IF DAY16I IS 1 THEN '#16' ELSE '';
DAY17Desc/A4 = IF DAY17I IS 1 THEN '#17' ELSE '';
DAY18Desc/A4 = IF DAY18I IS 1 THEN '#18' ELSE '';
DAY19Desc/A4 = IF DAY19I IS 1 THEN '#19' ELSE '';
DAY20Desc/A4 = IF DAY20I IS 1 THEN '#20' ELSE '';
DAY21Desc/A4 = IF DAY21I IS 1 THEN '#21' ELSE '';
DAY22Desc/A4 = IF DAY22I IS 1 THEN '#22' ELSE '';
DAY23Desc/A4 = IF DAY23I IS 1 THEN '#23' ELSE '';
DAY24Desc/A4 = IF DAY24I IS 1 THEN '#24' ELSE '';
DAY25Desc/A4 = IF DAY25I IS 1 THEN '#25' ELSE '';
DAY26Desc/A4 = IF DAY26I IS 1 THEN '#26' ELSE '';
DAY27Desc/A4 = IF DAY27I IS 1 THEN '#27' ELSE '';
DAY28Desc/A4 = IF DAY28I IS 1 THEN '#28' ELSE '';
DAY29Desc/A4 = IF DAY29I IS 1 THEN '#29' ELSE '';
DAY30Desc/A4 = IF DAY30I IS 1 THEN '#30' ELSE '';
DAY31Desc/A4 = IF DAY31I IS 1 THEN '#31' ELSE '';
DAY32Desc/A4 = IF DAY32I IS 1 THEN '#EOM' ELSE '';
NBRDAYS_PER_MO/I2 MISSING ON = IF INTERVALTYPE NE 'M' THEN MISSING ELSE
IF MONTHRUN_TYPE IS 'DOW' THEN 1 ELSE
DAY01I + DAY02I + DAY03I + DAY04I + DAY05I + DAY06I + DAY07I + DAY08I + DAY09I + DAY10I +
DAY11I + DAY12I + DAY13I + DAY14I + DAY15I + DAY16I + DAY17I + DAY18I + DAY19I + DAY20I +
DAY21I + DAY22I + DAY23I + DAY24I + DAY25I + DAY26I + DAY27I + DAY28I + DAY29I + DAY30I + DAY31I + DAY32I;
DAYNBR_OR_DOW/A4 = IF INTERVALTYPE NE 'M' THEN '' ELSE
IF MONTHRUN_TYPE IS 'DOW' THEN 'DOW' ELSE 'Day#' ;
MONTH_DAYNBR/I2 = IF INTERVALTYPE NE 'M' THEN 0 ELSE IF MONTHRUN_TYPE NE 'DAY#' THEN 0 ELSE
IF NBRDAYS_PER_MO GT 1 THEN 0 ELSE
IF DAY01I IS 1 THEN 1 ELSE IF DAY02I IS 1 THEN 2 ELSE IF DAY03I IS 1 THEN 3 ELSE IF DAY04I IS 1 THEN 4 ELSE IF DAY05I IS 1 THEN 5 ELSE
IF DAY06I IS 1 THEN 6 ELSE IF DAY07I IS 1 THEN 7 ELSE IF DAY08I IS 1 THEN 8 ELSE IF DAY09I IS 1 THEN 9 ELSE IF DAY10I IS 1 THEN 10 ELSE
IF DAY11I IS 1 THEN 11 ELSE IF DAY12I IS 1 THEN 12 ELSE IF DAY13I IS 1 THEN 13 ELSE IF DAY14I IS 1 THEN 14 ELSE IF DAY15I IS 1 THEN 15 ELSE
IF DAY16I IS 1 THEN 16 ELSE IF DAY17I IS 1 THEN 17 ELSE IF DAY18I IS 1 THEN 18 ELSE IF DAY19I IS 1 THEN 19 ELSE IF DAY20I IS 1 THEN 21 ELSE
IF DAY21I IS 1 THEN 21 ELSE IF DAY22I IS 1 THEN 22 ELSE IF DAY23I IS 1 THEN 23 ELSE IF DAY24I IS 1 THEN 24 ELSE IF DAY25I IS 1 THEN 25 ELSE
IF DAY26I IS 1 THEN 26 ELSE IF DAY27I IS 1 THEN 27 ELSE IF DAY28I IS 1 THEN 28 ELSE IF DAY29I IS 1 THEN 29 ELSE IF DAY30I IS 1 THEN 30 ELSE
IF DAY31I IS 1 THEN 31 ELSE IF DAY32I IS 1 THEN 32 ELSE 0;
-* need to handle the last day of the month
DAYRUN/A10 = IF INTERVALTYPE NE 'M' THEN '' ELSE
IF MONTHRUN_TYPE IS 'DOW' THEN '' ELSE
IF DATES IS '00000000000000000000000000000001' THEN '#EOM' ELSE
IF DATES IS '10000000000000000000000000000000' THEN '#01' ELSE
IF NBRDAYS_PER_MO GT 1 THEN 'Multiple' ELSE
IF DAY02I IS 1 THEN '#02' ELSE IF DAY03I IS 1 THEN '#03' ELSE IF DAY04I IS 1 THEN '#04' ELSE IF DAY05I IS 1 THEN '#05' ELSE IF DAY06I IS 1 THEN '#06' ELSE
IF DAY07I IS 1 THEN '#07' ELSE IF DAY08I IS 1 THEN '#08' ELSE IF DAY09I IS 1 THEN '#09' ELSE IF DAY10I IS 1 THEN '#10' ELSE IF DAY11I IS 1 THEN '#11' ELSE
IF DAY12I IS 1 THEN '#12' ELSE IF DAY13I IS 1 THEN '#13' ELSE IF DAY14I IS 1 THEN '#14' ELSE IF DAY15I IS 1 THEN '#15' ELSE IF DAY16I IS 1 THEN '#16' ELSE
IF DAY17I IS 1 THEN '#17' ELSE IF DAY18I IS 1 THEN '#18' ELSE IF DAY19I IS 1 THEN '#19' ELSE IF DAY20I IS 1 THEN '#20' ELSE IF DAY21I IS 1 THEN '#21' ELSE
IF DAY22I IS 1 THEN '#22' ELSE IF DAY23I IS 1 THEN '#23' ELSE IF DAY24I IS 1 THEN '#24' ELSE IF DAY25I IS 1 THEN '#25' ELSE IF DAY26I IS 1 THEN '#26' ELSE
IF DAY27I IS 1 THEN '#27' ELSE IF DAY28I IS 1 THEN '#28' ELSE IF DAY29I IS 1 THEN '#29' ELSE IF DAY30I IS 1 THEN '#30' ELSE IF DAY31I IS 1 THEN '#31' ELSE '';
DAYSCONCAT/A100 = IF INTERVALTYPE NE 'M' THEN '' ELSE IF NBRDAYS_PER_MO IS 1 THEN '' ELSE
DAY01Desc || DAY02Desc || DAY03Desc || DAY04Desc || DAY05Desc || DAY06Desc || DAY07Desc || DAY08Desc || DAY09Desc || DAY10Desc ||
DAY11Desc || DAY12Desc || DAY13Desc || DAY14Desc || DAY15Desc || DAY16Desc || DAY17Desc || DAY18Desc || DAY19Desc || DAY20Desc ||
DAY21Desc || DAY22Desc || DAY23Desc || DAY24Desc || DAY25Desc || DAY26Desc || DAY27Desc || DAY28Desc || DAY29Desc || DAY30Desc ||
DAY31Desc || DAY32Desc;
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'0#', 3, '0,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'1#', 3, '1,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'2#', 3, '2,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'3#', 3, '3,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'4#', 3, '4,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'5#', 3, '5,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'6#', 3, '6,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'7#', 3, '7,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'8#', 3, '8,#',100,DAYSCONCAT);
DAYSCONCAT/A100 = STRREP(100,DAYSCONCAT,2,'9#', 3, '9,#',100,DAYSCONCAT);
DAYRUN_DESC/A100 = IF NBRDAYS_PER_MO IS 1 THEN DAYRUN ELSE DAYSCONCAT;
MONTH_FREQUENCY/A100 = IF INTERVALTYPE NE 'M' THEN '' ELSE
IF MONTHRUN_TYPE IS 'DOW' THEN MONTHRUN_FREQ ELSE DAYRUN_DESC;
CUSTOMDATE_I8YYMD/I8YYMD = EDIT(CUSTOMDATE);
CUSTOMDATE_YYMD/YYMD = CUSTOMDATE_I8YYMD;
ANNUAL_DATE_MONTHDAY/A4 = IF INTERVALTYPE IS 'Y' THEN EDIT(STARTDATE_A8YYMD,'$$$$9999') ELSE '9999';
ANNUAL_DATE_A8YYMD1/A8YYMD = PARM_STARTDATE_YEAR || ANNUAL_DATE_MONTHDAY;
ANNUAL_DATE_I8YYMD1/I8YYMD = EDIT(ANNUAL_DATE_A8YYMD1);
ANNUAL_DATE_YYMD1/YYMD = ANNUAL_DATE_I8YYMD1;
ANNUAL_DATE_A8YYMD2/A8YYMD = PARM_ENDDATE_YEAR || ANNUAL_DATE_MONTHDAY;
ANNUAL_DATE_I8YYMD2/I8YYMD = EDIT(ANNUAL_DATE_A8YYMD2);
ANNUAL_DATE_YYMD2/YYMD = ANNUAL_DATE_I8YYMD2;
PAST_ENDDATE/A1 = IF ENDDATE_YYMD LT PARM_STARTDATE THEN 'Y' ELSE 'N';
NEXT_DAY1/I8YYMD = DATEADD(PARM_STARTDATE,'D',1);
NEXT_DAY2/I8YYMD = DATEADD(PARM_STARTDATE,'D',2);
NEXT_DAY3/I8YYMD = DATEADD(PARM_STARTDATE,'D',3);
NEXT_DAY4/I8YYMD = DATEADD(PARM_STARTDATE,'D',4);
NEXT_DAY1_DOW/A4 = DOWK(NEXT_DAY1, NEXT_DAY1_DOW);
NEXT_DAY2_DOW/A4 = DOWK(NEXT_DAY2, NEXT_DAY2_DOW);
NEXT_DAY3_DOW/A4 = DOWK(NEXT_DAY3, NEXT_DAY3_DOW);
NEXT_DAY4_DOW/A4 = DOWK(NEXT_DAY4, NEXT_DAY4_DOW);
DAYS_RANGE/A30 = IF &RangeDays GE 7 THEN 'MON,TUE,WED,THU,FRI,SAT,SUN' ELSE
IF &RangeDays IS 1 THEN PARM_STARTDATE_DOW ELSE
IF &RangeDays IS 2 THEN PARM_STARTDATE_DOW || ',' || PARM_ENDDATE_DOW ELSE
IF &RangeDays IS 3 THEN PARM_STARTDATE_DOW || ',' || NEXT_DAY1_DOW || ',' || PARM_ENDDATE_DOW ELSE
IF &RangeDays IS 4 THEN PARM_STARTDATE_DOW || ',' || NEXT_DAY1_DOW || ',' || NEXT_DAY2_DOW || ',' || PARM_ENDDATE_DOW ELSE
IF &RangeDays IS 5 THEN PARM_STARTDATE_DOW || ',' || NEXT_DAY1_DOW || ',' || NEXT_DAY2_DOW || ',' || NEXT_DAY3_DOW || ',' || PARM_ENDDATE_DOW ELSE
IF &RangeDays IS 6 THEN PARM_STARTDATE_DOW || ',' || NEXT_DAY1_DOW || ',' || NEXT_DAY2_DOW || ',' || NEXT_DAY3_DOW || ',' || NEXT_DAY4_DOW || ',' || PARM_ENDDATE_DOW ELSE 'BADDAYS';
ACTIVE_CUSTOM/A1 = IF INTERVALTYPE NE 'C' THEN 'N' ELSE
IF CUSTOMDATE_YYMD GE PARM_STARTDATE AND CUSTOMDATE_YYMD LE PARM_ENDDATE THEN 'Y' ELSE 'N';
ACTIVE_DAILY/A1 = IF INTERVALTYPE NE 'D' THEN 'N' ELSE
IF ANYDOW IS 'Y' OR &RangeDays GE 7 THEN 'Y' ELSE
IF RUNS_MON IS 'Y' AND DAYS_RANGE CONTAINS MON_LITERAL THEN 'Y' ELSE
IF RUNS_TUE IS 'Y' AND DAYS_RANGE CONTAINS TUE_LITERAL THEN 'Y' ELSE
IF RUNS_WED IS 'Y' AND DAYS_RANGE CONTAINS WED_LITERAL THEN 'Y' ELSE
IF RUNS_THU IS 'Y' AND DAYS_RANGE CONTAINS THU_LITERAL THEN 'Y' ELSE
IF RUNS_FRI IS 'Y' AND DAYS_RANGE CONTAINS FRI_LITERAL THEN 'Y' ELSE
IF RUNS_SAT IS 'Y' AND DAYS_RANGE CONTAINS SAT_LITERAL THEN 'Y' ELSE
IF RUNS_SUN IS 'Y' AND DAYS_RANGE CONTAINS SUN_LITERAL THEN 'Y' ELSE 'N';
ACTIVE_WEEKLY/A1 = IF INTERVALTYPE NE 'W' THEN 'N' ELSE
IF ANYDOW IS 'Y' THEN 'Y' ELSE
IF &RangeDays GE 7 THEN 'Y' ELSE
IF RUNS_MON IS 'Y' AND DAYS_RANGE CONTAINS MON_LITERAL THEN 'Y' ELSE
IF RUNS_TUE IS 'Y' AND DAYS_RANGE CONTAINS TUE_LITERAL THEN 'Y' ELSE
IF RUNS_WED IS 'Y' AND DAYS_RANGE CONTAINS WED_LITERAL THEN 'Y' ELSE
IF RUNS_THU IS 'Y' AND DAYS_RANGE CONTAINS THU_LITERAL THEN 'Y' ELSE
IF RUNS_FRI IS 'Y' AND DAYS_RANGE CONTAINS FRI_LITERAL THEN 'Y' ELSE
IF RUNS_SAT IS 'Y' AND DAYS_RANGE CONTAINS SAT_LITERAL THEN 'Y' ELSE
IF RUNS_SUN IS 'Y' AND DAYS_RANGE CONTAINS SUN_LITERAL THEN 'Y' ELSE 'N';
-* still need logic for every other x (daily, weekly, YSU has no monthly, yearly)
-* Need DATES logic for monthly options:
-* Day# in DATES using 0 and 1 (can be multiples, like 11th day and Last DOM)
-* Last DOM is in DATES as all zeros except for 32nd which is 1
-* Use DOW is in DATES as A1, 2nd A2, 3rd A3, 4th A4, Last A5
-* Monthly Class1: run once on a certain day#
-* Monthly Class2: run multiple times on certain day#
-* Monthly Class3: run on particular weekday (every 1st, 2nd, 3rd, 4th, last)
-* Monthly Class4: run on particular weekday (every x month)
MONTH_CLASS/A1 = IF INTERVALTYPE NE 'M' THEN 'N' ELSE
IF MONTHRUN_TYPE IS 'DAY#' AND MONTH_FREQUENCY IS '#EOM' THEN '4' ELSE
IF MONTHRUN_TYPE IS 'DAY#' AND NBRDAYS_PER_MO IS 1 THEN '1' ELSE
IF MONTHRUN_TYPE IS 'DAY#' AND NBRDAYS_PER_MO GT 1 THEN '2' ELSE
IF MONTHRUN_TYPE IS 'DOW' AND RUNEVERY IS '1' THEN '3' ELSE 'X';
ACTIVE_MONTHLY/A1 = IF INTERVALTYPE NE 'M' THEN 'N' ELSE
IF &RangeMonths GE 2 THEN 'Y' ELSE
IF MONTH_CLASS IS '1' AND &RangeMonths IS 1 AND MONTH_DAYNBR FROM &RangeStart_DD TO &RangeEnd_DD THEN 'Y' ELSE
IF MONTH_CLASS IS '1' AND PARM_RANGE_SPANS_MONTH IS 'Y' AND MONTH_DAYNBR LE &RangeEnd_DD THEN 'Y' ELSE
IF MONTH_CLASS IS '1' AND PARM_RANGE_HAS_EOM IS 'Y' AND DAY32I IS 1 THEN 'Y' ELSE
IF MONTH_CLASS IS '1' THEN 'N' ELSE
IF MONTH_CLASS IS '2' AND PARM_RANGE_HAS_EOM IS 'Y' AND MONTH_FREQUENCY CONTAINS '#EOM' THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY01I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 1 AND PARM_ENDDATE_DAY GE 1) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY02I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 2 AND PARM_ENDDATE_DAY GE 2) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY03I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 3 AND PARM_ENDDATE_DAY GE 3) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY04I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 4 AND PARM_ENDDATE_DAY GE 4) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY05I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 5 AND PARM_ENDDATE_DAY GE 5) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY06I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 6 AND PARM_ENDDATE_DAY GE 6) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY07I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 7 AND PARM_ENDDATE_DAY GE 7) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY08I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 8 AND PARM_ENDDATE_DAY GE 8) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY09I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 9 AND PARM_ENDDATE_DAY GE 9) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY10I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 10 AND PARM_ENDDATE_DAY GE 10) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY11I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 11 AND PARM_ENDDATE_DAY GE 11) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY12I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 12 AND PARM_ENDDATE_DAY GE 12) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY13I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 13 AND PARM_ENDDATE_DAY GE 13) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY14I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 14 AND PARM_ENDDATE_DAY GE 14) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY15I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 15 AND PARM_ENDDATE_DAY GE 15) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY16I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 16 AND PARM_ENDDATE_DAY GE 16) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY17I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 17 AND PARM_ENDDATE_DAY GE 17) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY18I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 18 AND PARM_ENDDATE_DAY GE 18) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY19I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 19 AND PARM_ENDDATE_DAY GE 19) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY20I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 20 AND PARM_ENDDATE_DAY GE 20) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY21I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 21 AND PARM_ENDDATE_DAY GE 21) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY22I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 22 AND PARM_ENDDATE_DAY GE 22) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY23I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 23 AND PARM_ENDDATE_DAY GE 23) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY24I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 24 AND PARM_ENDDATE_DAY GE 24) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY25I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 25 AND PARM_ENDDATE_DAY GE 25) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY26I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 26 AND PARM_ENDDATE_DAY GE 26) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY27I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 27 AND PARM_ENDDATE_DAY GE 27) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY28I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 28 AND PARM_ENDDATE_DAY GE 28) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY29I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 29 AND PARM_ENDDATE_DAY GE 29) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY30I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 30 AND PARM_ENDDATE_DAY GE 30) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY31I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'N' AND (PARM_STARTDATE_DAY LE 31 AND PARM_ENDDATE_DAY GE 31) THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY01I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 1 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY02I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 2 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY03I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 3 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY04I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 4 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY05I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 5 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY06I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 6 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY07I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 7 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY08I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 8 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY09I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 9 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY10I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 10 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY11I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 11 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY12I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 12 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY13I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 13 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY14I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 14 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY15I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 15 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY16I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 16 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY17I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 17 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY18I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 18 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY19I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 19 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY20I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 20 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY21I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 21 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY22I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 22 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY23I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 23 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY24I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 24 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY25I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 25 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY26I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 26 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY27I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 27 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY28I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 28 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY29I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 29 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY30I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 30 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' AND DAY31I IS 1 AND PARM_RANGE_SPANS_MONTH IS 'Y' AND PARM_ENDDATE_DAY GE 31 THEN 'Y' ELSE
IF MONTH_CLASS IS '2' THEN 'N' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Mo' AND PARM_STARTDATE_I8YYMD LE &FIRSTMON AND PARM_ENDDATE_I8YYMD GE &FIRSTMON THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Tu' AND PARM_STARTDATE_I8YYMD LE &FIRSTTUE AND PARM_ENDDATE_I8YYMD GE &FIRSTTUE THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'We' AND PARM_STARTDATE_I8YYMD LE &FIRSTWED AND PARM_ENDDATE_I8YYMD GE &FIRSTWED THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Th' AND PARM_STARTDATE_I8YYMD LE &FIRSTTHU AND PARM_ENDDATE_I8YYMD GE &FIRSTTHU THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Fr' AND PARM_STARTDATE_I8YYMD LE &FIRSTFRI AND PARM_ENDDATE_I8YYMD GE &FIRSTFRI THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Sa' AND PARM_STARTDATE_I8YYMD LE &FIRSTSAT AND PARM_ENDDATE_I8YYMD GE &FIRSTSAT THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '1st' AND WEEKDAYS_RUN IS 'Su' AND PARM_STARTDATE_I8YYMD LE &FIRSTSUN AND PARM_ENDDATE_I8YYMD GE &FIRSTSUN THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Mo' AND PARM_STARTDATE_I8YYMD LE &SECONDMON AND PARM_ENDDATE_I8YYMD GE &SECONDMON THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Tu' AND PARM_STARTDATE_I8YYMD LE &SECONDTUE AND PARM_ENDDATE_I8YYMD GE &SECONDTUE THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'We' AND PARM_STARTDATE_I8YYMD LE &SECONDWED AND PARM_ENDDATE_I8YYMD GE &SECONDWED THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Th' AND PARM_STARTDATE_I8YYMD LE &SECONDTHU AND PARM_ENDDATE_I8YYMD GE &SECONDTHU THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Fr' AND PARM_STARTDATE_I8YYMD LE &SECONDFRI AND PARM_ENDDATE_I8YYMD GE &SECONDFRI THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Sa' AND PARM_STARTDATE_I8YYMD LE &SECONDSAT AND PARM_ENDDATE_I8YYMD GE &SECONDSAT THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '2nd' AND WEEKDAYS_RUN IS 'Su' AND PARM_STARTDATE_I8YYMD LE &SECONDSUN AND PARM_ENDDATE_I8YYMD GE &SECONDSUN THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Mo' AND PARM_STARTDATE_I8YYMD LE &THIRDMON AND PARM_ENDDATE_I8YYMD GE &THIRDMON THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Tu' AND PARM_STARTDATE_I8YYMD LE &THIRDTUE AND PARM_ENDDATE_I8YYMD GE &THIRDTUE THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'We' AND PARM_STARTDATE_I8YYMD LE &THIRDWED AND PARM_ENDDATE_I8YYMD GE &THIRDWED THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Th' AND PARM_STARTDATE_I8YYMD LE &THIRDTHU AND PARM_ENDDATE_I8YYMD GE &THIRDTHU THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Fr' AND PARM_STARTDATE_I8YYMD LE &THIRDFRI AND PARM_ENDDATE_I8YYMD GE &THIRDFRI THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Sa' AND PARM_STARTDATE_I8YYMD LE &THIRDSAT AND PARM_ENDDATE_I8YYMD GE &THIRDSAT THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '3rd' AND WEEKDAYS_RUN IS 'Su' AND PARM_STARTDATE_I8YYMD LE &THIRDSUN AND PARM_ENDDATE_I8YYMD GE &THIRDSUN THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Mo' AND PARM_STARTDATE_I8YYMD LE &FOURTHMON AND PARM_ENDDATE_I8YYMD GE &FOURTHMON THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Tu' AND PARM_STARTDATE_I8YYMD LE &FOURTHTUE AND PARM_ENDDATE_I8YYMD GE &FOURTHTUE THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'We' AND PARM_STARTDATE_I8YYMD LE &FOURTHWED AND PARM_ENDDATE_I8YYMD GE &FOURTHWED THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Th' AND PARM_STARTDATE_I8YYMD LE &FOURTHTHU AND PARM_ENDDATE_I8YYMD GE &FOURTHTHU THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Fr' AND PARM_STARTDATE_I8YYMD LE &FOURTHFRI AND PARM_ENDDATE_I8YYMD GE &FOURTHFRI THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Sa' AND PARM_STARTDATE_I8YYMD LE &FOURTHSAT AND PARM_ENDDATE_I8YYMD GE &FOURTHSAT THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS '4th' AND WEEKDAYS_RUN IS 'Su' AND PARM_STARTDATE_I8YYMD LE &FOURTHSUN AND PARM_ENDDATE_I8YYMD GE &FOURTHSUN THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Mo' AND PARM_STARTDATE_I8YYMD LE &LASTMON AND PARM_ENDDATE_I8YYMD GE &LASTMON THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Tu' AND PARM_STARTDATE_I8YYMD LE &LASTTUE AND PARM_ENDDATE_I8YYMD GE &LASTTUE THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'We' AND PARM_STARTDATE_I8YYMD LE &LASTWED AND PARM_ENDDATE_I8YYMD GE &LASTWED THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Th' AND PARM_STARTDATE_I8YYMD LE &LASTTHU AND PARM_ENDDATE_I8YYMD GE &LASTTHU THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Fr' AND PARM_STARTDATE_I8YYMD LE &LASTFRI AND PARM_ENDDATE_I8YYMD GE &LASTFRI THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Sa' AND PARM_STARTDATE_I8YYMD LE &LASTSAT AND PARM_ENDDATE_I8YYMD GE &LASTSAT THEN 'Y' ELSE
IF MONTH_CLASS IS '3' AND MONTHRUN_FREQ IS 'Last' AND WEEKDAYS_RUN IS 'Su' AND PARM_STARTDATE_I8YYMD LE &LASTSUN AND PARM_ENDDATE_I8YYMD GE &LASTSUN THEN 'Y' ELSE
IF MONTH_CLASS IS '3' THEN 'N' ELSE
IF MONTH_CLASS IS '4' AND PARM_RANGE_HAS_EOM IS 'Y' THEN 'Y' ELSE
IF MONTH_CLASS IS '4' THEN 'N' ELSE
'N';
ACTIVE_YEARLY/A1 = IF INTERVALTYPE NE 'Y' THEN 'N' ELSE
IF &RangeYears GE 2 THEN 'Y' ELSE
IF ANNUAL_DATE_YYMD1 FROM PARM_STARTDATE TO PARM_ENDDATE THEN 'Y' ELSE
IF ANNUAL_DATE_YYMD2 FROM PARM_STARTDATE TO PARM_ENDDATE THEN 'Y' ELSE 'N';
-* really counting number of custom dates, giving other interval types a 1
NUMBER_JOBS/I1 = IF ACTIVE_CUSTOM IS 'Y' THEN 1 ELSE
IF ACTIVE_DAILY IS 'Y' THEN 1 ELSE
IF ACTIVE_WEEKLY IS 'Y' THEN 1 ELSE
IF ACTIVE_MONTHLY IS 'Y' THEN 1 ELSE
IF ACTIVE_YEARLY IS 'Y' THEN 1 ELSE 0;
-* WIP: need to handle all interval types
-* still working on Monthly, so showing all for now
ACTIVE_JOB/A1 = IF INTERVALTYPE IS 'C' THEN 'Y' ELSE
IF INTERVALTYPE IS 'M' AND ACTIVE_MONTHLY IS 'Y' THEN 'Y' ELSE
IF INTERVALTYPE IS 'M' AND MONTH_CLASS IS 'X' THEN 'Y' ELSE
IF INTERVALTYPE IS 'D' AND ACTIVE_DAILY IS 'Y' THEN 'Y' ELSE
IF INTERVALTYPE IS 'W' AND ACTIVE_WEEKLY IS 'Y' THEN 'Y' ELSE
IF INTERVALTYPE IS 'Y' AND ACTIVE_YEARLY IS 'Y' THEN 'Y' ELSE 'N';
END
TABLE FILE BOTSCHED
WHERE ACTIVE IS 'Y';
WHERE INTERVALTYPE IS '&IntervalType.EVAL';
WHERE LASTEXSTATUS IS '&LastRunStatus.EVAL';
WHERE UPJOBDESC CONTAINS '&UPSEARCH.EVAL' OR UPPACKETNAME CONTAINS '&UPSEARCH.EVAL' OR UPTASKNAME CONTAINS '&UPSEARCH.EVAL';
WHERE ACTIVE_JOB IS 'Y';
WHERE PAST_ENDDATE NE 'Y';
WHERE INTERVALTYPE NE 'O';
WRITE
REALLYACTIVE NOPRINT
-* DATES
-* PARM_STARTDATE_I8YYMD PARM_ENDDATE_I8YYMD
-* PARM_STARTDATE_DOW PARM_ENDDATE_DOW PAST_ENDDATE
-* NUMBER_JOBS
-* ACTIVE_DAILY ACTIVE_WEEKLY ACTIVE_YEARLY
ACTIVE_MONTH MONTH_CLASS MONTH_DAYNBR DAY11I
-* STARTDATE_A8YYMD ANNUAL_DATE_MONTHDAY
-* ANNUAL_DATE_YYMD1 ANNUAL_DATE_A8YYMD1 ANNUAL_DATE_I8YYMD1
-* ANNUAL_DATE_YYMD2 ANNUAL_DATE_A8YYMD2 ANNUAL_DATE_I8YYMD2
-* NOPRINT
-* BY JOBDESC AS 'Job Description'
-* BY CASTER_USER AS 'RC UserID'
-* BY NOTIFY_SUBJECT AS 'Notify Subject'
-* BY FULLDISTLIST AS 'Distribution List'
BY INTERVALDESC AS 'Interval'
BY JOBDESC AS 'Job Description'
BY NBRDAYS_PER_MO AS '#Days,per,Month'
BY DAYNBR_OR_DOW AS 'Day#,or,DOW'
BY MONTH_FREQUENCY AS 'Month,Frequency'
BY WEEKDAYS_RUN AS 'WeekDays,Run'
BY RUNEVERY AS 'Every'
-* BY STARTTIMEZONE AS 'Start Timezone'
BY STARTDATE_YYMD AS 'Started,Running'
-* BY STARTTIME_FMTD AS 'Started,Time'
BY ENDDATE_YYMD AS 'Stops,Running'
-* BY ENDTIME_FMTD AS 'Stops,Time'
BY LAST_RUNTIME AS 'Last Run'
BY LASTEXSTATUS AS 'Last Status'
BY NEXT_RUNTIME AS 'Next Run'
-* BY CUSTOMDATE AS 'Custom Date'
-IF &Details IS 'N' THEN GOTO SKIP_DETAIL;
BY DESC1 AS 'Packet Name'
BY TASKNAME AS 'Task Name'
BY TASKOBJPATH AS 'Task Object Path'
-SKIP_DETAIL
-IF &Parameters IS 'N' THEN GOTO SKIP_PARMS;
BY PARAM_NAME AS 'Parameter Name'
BY PARAM_VALUE AS 'Parameter Value'
-SKIP_PARMS
WHERE TOTAL NUMBER_JOBS GT 0 OR INTERVALTYPE IS 'M';
HEADING
"Scheduled Jobs &SearchStringDesc.EVAL "
"Will Run from &RangeStart.EVAL through &RangeEnd.EVAL"
"Last Run Status: &LastRunStatusDesc / Interval Type: &IntervalTypeDesc.EVAL / Run on: &DATEMDYY.EVAL"
" "
-* "Testing: #Days: &RangeDays.EVAL #Months: &RangeMonths.EVAL PARM_YEARS=&RangeYears.EVAL StartDOW:<PARM_STARTDATE_DOW EndDOW:<PARM_ENDDATE_DOW"
-* "StartDay:&RangeStart_DD EndDay:&RangeEnd_DD StartEOM:<FST.PARM_STARTDATE_EOM RangeEOM?:<PARM_RANGE_HAS_EOM "
-* "NEXT_DAY1=<NEXT_DAY1 <NEXT_DAY1_DOW NEXT_DAY2=<NEXT_DAY2 <NEXT_DAY2_DOW NEXT_DAY3=<NEXT_DAY3 <NEXT_DAY3_DOW NEXT_DAY4=<NEXT_DAY4 NEXT_DAY4_DOW"
-* "DAYS_RANGE=<DAYS_RANGE"
-* "PARM_STARTDATE_YEAR=<PARM_STARTDATE_YEAR PARM_ENDDATE_YEAR=<PARM_ENDDATE_YEAR"
ON TABLE SET DROPBLNKLINE ALL
ON TABLE SET EMPTYREPORT ON
ON TABLE SET BYDISPLAY &BYDISPLAY
ON TABLE PCHOLD FORMAT &WFFMT AS 'Scheduled Jobs'
ON TABLE SET HTMLCSS ON
ON TABLE SET LINES 999999
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=HEADING,
JUSTIFY=CENTER,$
TYPE=REPORT,
TITLETEXT='Content Repository Search Results',
SQUEEZE=ON, ORIENTATION=LANDSCAPE,$
TYPE=DATA,
COLUMN=N1, COLOR='RED', STYLE=ITALIC,
WHEN=REALLYACTIVE EQ 'N', $
TYPE=DATA,
COLUMN=NEXT_RUNTIME, COLOR='RED', STYLE=ITALIC,
WHEN=LASTEXSTATUS EQ 'FAILURE', $
TYPE=DATA,
COLUMN=LASTEXSTATUS, COLOR='RED', STYLE=ITALIC,
WHEN=LASTEXSTATUS EQ 'FAILURE', $
TYPE=DATA,
COLUMN=LASTEXSTATUS, COLOR='BROWN', STYLE=ITALIC,
WHEN=LASTEXSTATUS EQ 'WARNING', $
TYPE=DATA,
COLUMN=NEXT_RUNTIME, COLOR='BROWN', STYLE=ITALIC,
WHEN=LASTEXSTATUS EQ 'WARNING', $
ENDSTYLE
END
-RUN