/*----------------------------------------------------------------------------- File: AssembleLinkPlusReport.sas Author: John Sabel john.sabel@ofm.wa.gov Washington State Education Research & Data Center Creation date: 1/31/12 Version: 0.9 Purpose This program "assembles" a Link Plus report from its constituent parts that were created in from a raw Link Plus report by running "ReadInLinkPlusReport.sas": 1) The Link Plus report header which contains column headings and other information (the parameter and dataset "MetadataDsnIn"), 2) The data itself (the parameter and dataset "ReportDsnIn"). Input Parameters: MetadataDsnIn: The two-level dataset name of the report header of a Link Plus report. ReportDsnIn: The two-level dataset name of the data of a Link Plus report that is the form as a SAS dataset. Debug: Not used. Hidden Input Parameters: Macro variables "put_1" and "put_2": Running the macro "ReadInLinkPlusReport.sas" creates these. Alternatively, you could use the single macro variable "justtabs" in lieu of "put_1" and "put_2", though you will need uncomment and comment out the appropriate lines. See the comments in the source code of "ReadInLinkPlusReport.sas" for more details. Output Parameters: LinkRptPathOut: The fully qualified file name of the Link Plus report to be create. ------------------------------------------------------------------------------- Copyright © 2012 Washington State Office of Financial Management This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -----------------------------------------------------------------------------*/ %macro AssembleLinkPlusReport(MetadataDsnIn=, ReportDsnIn=, LinkRptPathOut=, Debug=N); %put --- Start of %upcase(&sysmacroname) macro; /* Output metadata */ data _null_; file "&LinkRptPathOut."; set &MetadataDsnIn. end=eof; varlen = length(dataline); put dataline $varying200. varlen; run; /* Output data */ /* As far as Link Plus is concerned, the data step doesn't need the formats (i.e. 10., 6.0, 6.1), but they do make the modified report look a little more like the original report */ data _null_; file "&LinkRptPathOut." mod; set &ReportDsnIn. end=eof; put #2 LinkageID1 10. '09'x SetOrLinkID1 '09'x RecordNum1 '09'x &put_1. /* &justtabs. '09'x */ #3 LinkageID2 10. '09'x SetOrLinkID2 '09'x RecordNum2 '09'x &put_2. /* &justtabs. '09'x */ class 6.0 '09'x score 6.1; run; /* Link Plus wants last line of report file to contain just a CR/LF. That is what this does. */ data _null_; file "&LinkRptPathOut." mod; put; run; %if &Debug.=Y %then %do; %put NOTE: The Debug parameter was set to Y, but this macro does not have a debug mode.; %end; %put --- End of %upcase(&sysmacroname) macro; %mend AssembleLinkPlusReport;