Action Block Description: Verify if passed text 8 date in valid format. Return values: SPACES Everything is OK 1 Year is invalid 2 Month is invalid 3 Day is invalid for month and year 4 Text string is not numeric +- CAB_TEXT_IS_VALID_DATE_CCYYMMDD | IMPORTS: ... | EXPORTS: ... | LOCALS: ... | ENTITY ACTIONS: | 3 | SET export cmips_work text_1 TO SPACES 4 | SET local_all_numeric cmips_work text_10 TO "0123456789" 5 | 6 | NOTE ======== 6 | Character date should be in CCYYMMDD format 6 | ======== 7 | 8 | SET local cmips_work number_2 TO verify(import cmips_work text_8, local_all_numeric cmips_work text_10) 9 | 10 | +- IF local cmips_work number_2 IS EQUAL TO 0 11 | | 12 | | SET local cmips_work number_4 TO numtext(substr(import cmips_work text_8, 1, 4)) 13 | | 14 | | USE cab_num_is_valid_year 14 | | WHICH IMPORTS: Work View local cmips_work TO Work View import cmips_work 14 | | WHICH EXPORTS: Work View local cmips_work FROM Work View export cmips_work 15 | | 16 | | +- IF local cmips_work number_4 IS NOT EQUAL TO 0 17 | | | SET export cmips_work text_1 TO "1" 16 | | +-- 18 | | 19 | | +- IF export cmips_work text_1 IS EQUAL TO SPACES 20 | | | 21 | | | SET local cmips_work number_2 TO numtext(substr(import cmips_work text_8, 5, 2)) 22 | | | 23 | | | +- IF local cmips_work number_2 IS LESS OR EQUAL TO 0 23 | | | | OR local cmips_work number_2 IS GREATER THAN 12 24 | | | | SET export cmips_work text_1 TO "2" 23 | | | +-- 19 | | +-- 25 | | 26 | | +- IF export cmips_work text_1 IS EQUAL TO SPACES 27 | | | 28 | | | SET local cmips_work number_2 TO numtext(substr(import cmips_work text_8, 5, 2)) 29 | | | SET local cmips_work number_4 TO numtext(substr(import cmips_work text_8, 1, 4)) 30 | | | 31 | | | SET month_end cmips_work date TO datenum(1 + 100 * local cmips_work number_2 + 10000 * 31 | | | local cmips_work number_4) 32 | | | 33 | | | USE cab_get_month_last_day 33 | | | WHICH IMPORTS: Work View month_end cmips_work TO Work View import cmips_work 33 | | | WHICH EXPORTS: Work View month_end cmips_work FROM Work View export cmips_work 34 | | | 35 | | | SET local cmips_work number_2 TO numtext(substr(import cmips_work text_8, 7, 2)) 36 | | | 37 | | | +- IF local cmips_work number_2 IS LESS THAN 1 37 | | | | OR local cmips_work number_2 IS GREATER THAN day(month_end cmips_work date) 38 | | | | 39 | | | | SET export cmips_work text_1 TO "3" 37 | | | +-- 26 | | +-- 10 | +- ELSE 40 | | SET export cmips_work text_1 TO "4" 10 | +-- +--