Usage Note 11727: Sample code to display the SASĀ® IT Charge Management accounting periods and invoice dates
SAS IT Charge Management sites can submit the following sample report to create a report of their accounting periods and invoice dates. This program is not shipped with the product, and it is a sample program only.
LIBNAME SITE 'USERID.EC.SITE' DISP=SHR;
%GLOBAL RANGEST RANGEND;
DATA TEMP (KEEP=INVSTDT INVEND);
SET SITE.EC_IN;
ARRAY INVDELTA(1350) ECIND001-ECIND1350;
RETAIN INVDT ACTYEAR C 0;
DO I=1 TO 1350;
IF INVDELTA{I} GT . THEN DO;
IF I EQ 1 THEN DO;
INVSTDT=ECINSTDT;
INVEND=ECINSTDT+(INVDELTA{I}-1);
OUTPUT;
END;
ELSE DO;
INVSTDT=INVEND+1;
INVEND=INVEND+INVDELTA{I};
OUTPUT;
END;
END;
IF INVDELTA{I} EQ . AND C EQ 0 THEN DO;
RANGEND=PUT(INVEND,DATE9.);
RANGEST=PUT(ECINSTDT,DATE9.);
CALL SYMPUT('RANGEND',RANGEND);
CALL SYMPUT('RANGEST',RANGEST);
C+1;
END;
END;
PROC SORT DATA=TEMP; BY INVSTDT;
PROC PRINT DATA=TEMP SPLIT='*' NOOBS;
VAR INVSTDT INVEND;
TITLE1 'IT CHARGE MANAGEMENT';
TITLE2 'INVOICE SCHEDULE DEFINITIONS';
TITLE3 "DATE RANGE: &RANGEST THROUGH &RANGEND";
LABEL INVEND='INVOICE*PERIOD*END' INVSTDT='INVOICE*PERIOD*START';
FORMAT INVEND DATE9. INVSTDT DATE9.;
RUN;
%GLOBAL RANGEST RANGEND;
DATA TEMP (KEEP=INVSTRT INVEND ACTYEAR ACTPER);
SET SITE.EC_CA;
ARRAY PERDELTA(300) ECCAD001-ECCAD300;
ARRAY AYEAR(300) ECCAY001-ECCAY300;
RETAIN INVSTRT INVEND ACTYEAR ACTPER ECCASTDT 0;
DO I=1 TO 300;
IF I LE ECCADNR THEN DO;
IF I EQ 1 THEN DO;
ACTYEAR=ECCASTYR;
ACTPER =I;
INVSTRT=ECCASTDT;
INVEND=ECCASTDT+(PERDELTA{I}-1);
OUTPUT;
END;
ELSE DO;
ACTYEAR=AYEAR{I};
IF ACTYEAR=AYEAR{I-1} THEN ACTPER=ACTPER+1;
ELSE ACTPER=1;
INVSTRT=INVEND+1;
INVEND=INVEND+PERDELTA{I};
OUTPUT;
IF I EQ ECCADNR THEN DO;
IF INVEND=. THEN RANGEND=PUT(INVSTRT,DATE9.);
ELSE RANGEND=PUT(INVEND,DATE9.);
RANGEST=PUT(ECCASTDT,DATE9.);
CALL SYMPUT('RANGEND',RANGEND);
CALL SYMPUT('RANGEST',RANGEST);
END;
END;
END;
ELSE DO;
RETURN;
END;
END;
RUN;
PROC SORT DATA=TEMP; BY ACTYEAR ACTPER;
PROC PRINT DATA=TEMP SPLIT='*';
BY ACTYEAR;
ID ACTYEAR;
VAR ACTPER INVSTRT INVEND;
TITLE1 'IT CHARGE MANAGEMENT';
TITLE2 'ACCOUNTING CALENDAR DEFINITIONS';
TITLE3 "DATE RANGE: &RANGEST THROUGH &RANGEND";
LABEL ACTYEAR='ACCOUNTING*YEAR' ACTPER='ACCOUNTING*PERIOD'
INVSTRT='ACCOUNTING*PERIOD*START' INVEND='ACCOUNTING*PERIOD*END';
FORMAT ACTYEAR 4. ACTPER 2 INVSTRT DATE9. INVEND DATE9.;
RUN;
TITLE 'LIST OF FORMATS IN ECSITE.ECUSER (UNFORMATTED DATES)';
PROC FORMAT FMTLIB LIBRARY=SITE.ECUSER CNTLOUT=FMTOUT;
SELECT ECINVSD;
RUN;
DATA INVDATES;
SET FMTOUT;
IF START NE : '*' OR END NE : '*' OR LABEL NE : '*';
ST=PUT(INPUT(LEFT(START),8.),DATE7.);
ED=PUT(INPUT(LEFT(END),8.),DATE7.);
LB=PUT(INPUT(LABEL,8.),DATE7.);
LABEL LB='INVOICE DATE' ST='START' ED='END';
RUN;
|
Operating System and Release Information
SAS System | SAS IT Charge Management | Microsoft Windows NT Workstation | 2.3 | | 8.2 TS2M0 | |
Microsoft Windows 95/98 | 2.3 | | 8.2 TS2M0 | |
Microsoft Windows 2000 Server | 2.3 | | 8.2 TS2M0 | |
Microsoft Windows 2000 Advanced Server | 2.3 | | 8.2 TS2M0 | |
Microsoft Windows 2000 Datacenter Server | 2.3 | | 8.2 TS2M0 | |
Microsoft Windows 2000 Professional | 2.3 | | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2007-11-20 10:16:24 |
Date Created: | 2004-02-03 13:42:39 |