No announcement yet.

Frequency Report

  • Filter
  • Time
  • Show
Clear All
new posts

  • Frequency Report

    These are instructions on how to set up a report that shows the frequency of each question in a dataset(s).

    1. Create Report using Program Code Below
    a. In System Administration\Report Library module, enter name of report, such as Frequency Listing
    b. Select Type = Normal
    c. Select or specify a Category
    d. Specify Notes, such as Produces a listing of frequencies by data set and field.
    e. Click edit, paste the program code (below), and close window
    f. Code Changes Exist field should now say ‘Yes’
    g. Click Save on the Report Library Window
    h. Click Go Back to return to the Reports menu

    2. Define the Report Template(s)
    a. Go to Report Templates, enter a name in the name input field (Frequency Listing)
    b. Select the level for the report as Global (available to all studies) in the Studies level selection box
    c. Specify a description for the report, such as Frequency Listing
    d. Select or specify a Category
    e. Set Report Type = Current Study Only
    f. In the program field, browse to select the program defined above
    g. There are no pre-processing or post-processing programs to specify
    h. In the Selection criteria, set the following values to provide investigator and patient selection
    1. Data set = PSYS._DATASETS
    2. Variable = DATASETNAME
    3. Selection Label = Data Set
    4. Dependant = N/A
    5. Type = Multiple
    i. On the output tab, set a custom output such as HTML, as opposed to the default SAS Text Output
    1. Layout = Landscape
    2. Check ‘Use ODS’
    3. Type = HTML or RTF or PDF (for rtf or pdf you need to have word or acrobat installed on the server)
    4. Set the style = RTF or Printer – Your choice, but these are preferred for reports because of their clear results
    5. Click Save to save the template

    Click image for larger version

Name:	freq.jpg
Views:	1
Size:	31.5 KB
ID:	543

    Program Code

    /**** Frequency Listing Report *****/
    %macro runit;
    %if &sel1 > 0 %then %do;
    %do i=1 %to &sel1;
    data work.&&sel1_&i;
    set pviews.&&sel1_&i(drop=datestamp batch barcode recordid sequence lastupdateddate);

    proc freq data=&&sel1_&i;
    table _all_;
    Title4 "Frequency Listing Data Set: &&sel1_&i";
    %else %do;
    data _null_;
    file print;
    put 'Note: No selection was made.';
    %mend runit;


    /*** End of Program ***/