Giter VIP home page Giter VIP logo

rogerjdeangelis / utl_formatting_proc_freq_output_using_a_template Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

Formatting proc freq output using a template. Keywords: sas sql join merge big data analytics macros oracle teradata mysql sas communities stackoverflow statistics artificial inteligence AI Python R Java Javascript WPS Matlab SPSS Scala Perl C C# Excel MS Access JSON graphics maps NLP natural language processing machine learning igraph DOSUBL DOW loop stackoverflow SAS community.

License: MIT License

SAS 100.00%

utl_formatting_proc_freq_output_using_a_template's Introduction

utl_formatting_proc_freq_output_using_a_template

Formatting proc freq output using a template. Keywords: sas sql join merge big data analytics macros oracle teradata mysql sas communities stackoverflow statistics artificial inteligence AI Python R Java Javascript WPS Matlab SPSS Scala Perl C C# Excel MS Access JSON graphics maps NLP natural language processing machine learning igraph DOSUBL DOW loop stackoverflow SAS community. Formatting proc freq output using a template

Preprocessing is more flexible and is less likely to paint you into a corner.
However a template is more universal. Six of one and half dozen of the other.

github
https://tinyurl.com/y6vjh5m7
https://github.com/rogerjdeangelis/utl_formatting_proc_freq_output_using_a_template

see
https://tinyurl.com/ybuhryf6
https://communities.sas.com/t5/Base-SAS-Programming/Format-results-of-Pro-Freg/m-p/485004


INPUT
=====

 The frequency variable is equivalent to repeating a Sex onservation
 1,2345,678.

 Also note there are 10 Males and 10 females

 WORK.CLASS total obs=20

   SEX    FREQUENCY

    M     12345678
    F     12345678
    F     12345678
    F     12345678
    M     12345678

 EXAMPLE OUTPUT
 --------------

  FREQUENCIES IN MILLIONS

                                      Cumulative     Cumulative
  SEX     Frequency       Percent      Frequency       Percent
  -------------------------------------------------------------
  F          1,234.57       50.00        1,234.57       50.00
  M          1,234.57       50.00        2,469.14      100.00


PROCESS
=======

proc format;
picture million (round fuzz=0)
0 -high = '009,999.00' (prefix='' mult=0.001);
run;

proc template;
   edit Base.Freq.OneWayList;
     edit frequency;
       format=million.;
     end;
     edit percent;
       format=8.2;
     end;
     edit cumfrequency;
       format=million.;
     end;
   end;
run;quit;

proc freq data=class;
title "Frequencies in Millions";
tables sex / list;
weight wgt;
run;quit;


OUTPUT
======

  FREQUENCIES IN MILLIONS

                                      Cumulative     Cumulative
  SEX     Frequency       Percent      Frequency       Percent
  -------------------------------------------------------------
  F          1,234.57       50.00        1,234.57       50.00
  M          1,234.57       50.00        2,469.14      100.00

*                _               _       _
 _ __ ___   __ _| | _____     __| | __ _| |_ __ _
| '_ ` _ \ / _` | |/ / _ \   / _` |/ _` | __/ _` |
| | | | | | (_| |   <  __/  | (_| | (_| | || (_| |
|_| |_| |_|\__,_|_|\_\___|   \__,_|\__,_|\__\__,_|

;
data class;
  set sashelp.class(keep=sex) end=dne;
  wgt=12345678;
  output;
  if dne then do;sex='F';output;end;
run;quit;

*          _       _   _
 ___  ___ | |_   _| |_(_) ___  _ __
/ __|/ _ \| | | | | __| |/ _ \| '_ \
\__ \ (_) | | |_| | |_| | (_) | | | |
|___/\___/|_|\__,_|\__|_|\___/|_| |_|

;
see process

utl_formatting_proc_freq_output_using_a_template's People

Contributors

rogerjdeangelis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.