For MICS sites that make use of a custom calendar controlled by the “13MONTHYEAR”
parameter in the CPLXDEF (complex-level) or SITE (unit-level) PARMS member, you
can write MICS/SAS code to test any user-defined (fiscal or otherwise special)
calendar and pass a date-value to determine what values will be assigned to the
MICS calendar-related common variables YEAR/YEAR4, MONTH, DAY, WEEK.
Here’s sample code that demonstrates how to test changes to the
MICS-defined special/fiscal calendar for the next 180 days:
//jobname JOB ....
//MICS EXEC MICSNDBx <- your unit ID goes here
//SYSIN DD DATA,DLM=ZZ
* We want to see the SAS source code. ;
OPTIONS SOURCE SOURCE2;
* Invoke MICS-maintained member that identifies MICS calendar options.;
%INCLUDE USOURCE($BASMSTR);
* This SAS DATA step generates diagnostic messages to test the ;
* user-defined MICS calendar code and displays the associated ;
* MICS Common Data Element assignments in SASLOG output. ;
DATA _NULL_;
* Use the SAS function TODAY to get the current date. ;
TESTDT=TODAY();
* If you want to start on a particular date, uncomment the next line. ;
* TESTDT = ‘ddmmmyyyy’D;
* Now loop on index variable I to increment the date for ;
* SASLOG printed output diagnostic purpose. ;
DO I=0 TO 180;
* Assign SAS date/time stamp using DHMS function. ;
ENDTS=DHMS(TESTDT+I,0,0,0);
* Compute MICS common elements based on calendar date.;
%CMNFLDS;
* Now display the diagnostic messages showing the MICS common ;
* elements. ;
PUTLOG '>> MICS CALENDAR-DERIVED VALUES: ' ENDDT= DATE9.
YEAR= YR. YEAR4= MONTH= DAY= WEEK=;
END;
STOP;
RUN;
ZZ
The sample code above can help MICS Administrators with testing MICS custom
calendar changes, for example with a future date-range. The SASLOG output will
display diagnostic information to verify expected results -- any missing values
can then be investigated.
Another calendar testing technique is to run the SCHEDULE jobstream and code
a SYSPARM with the TEST parameter, as documented in the PIOM Guide, Chapter 47.
A standard MICS calendar (no 13MONTHYEAR parameter is coded in the SITE
member) should also generate acceptable values unless the member
sharedprefix.SOURCE($DWMY12) has been modified -- not normally done.
Regards,
Scott Barry
Principal Consultant
SBBWorks, Inc.
EMAIL: sbarry@sbbworks.com