Giter VIP home page Giter VIP logo

utl-using-meta-data-to-create-customized-sas-tables-do-over's Introduction

utl-using-meta-data-to-create-customized-sas-tables-do-over

Using meta data to create customized sas tables dosubl SAS Forum: Using meta data to create customized sas tables do over

Great question well defined, Thanks.                                                                                           
                                                                                                                               
github                                                                                                                         
https://tinyurl.com/yy8bw5mm                                                                                                   
https://github.com/rogerjdeangelis/utl-using-meta-data-to-create-customized-sas-tables-do-over                                 
                                                                                                                               
SAS Forum                                                                                                                      
https://tinyurl.com/yyolb6rb                                                                                                   
https://communities.sas.com/t5/SAS-Programming/Translate-one-dataset-to-another-using-a-custom-metadata-dataset/m-p/584894     
                                                                                                                               
macros                                                                                                                         
https://tinyurl.com/y9nfugth                                                                                                   
https://github.com/rogerjdeangelis/utl-macros-used-in-many-of-rogerjdeangelis-repositories                                     
                                                                                                                               
*_                   _                                                                                                         
(_)_ __  _ __  _   _| |_                                                                                                       
| | '_ \| '_ \| | | | __|                                                                                                      
| | | | | |_) | |_| | |_                                                                                                       
|_|_| |_| .__/ \__,_|\__|                                                                                                      
        |_|                                                                                                                    
;                                                                                                                              
                                                                                                                               
data have;                                                                                                                     
 input                                                                                                                         
 (S_NAME S_ID S_DATE S_LOCATION S_REGION S_COMMENTS) ($) S_TEL $24.;                                                           
cards4;                                                                                                                        
Bill 1 21550 UK EMEA None +44 20 999 999                                                                                       
Adam 2 21581 UK EMEA Closing +44 20 999 998                                                                                    
Sean 3 21609 ES EMEA Open +34 01 889 887                                                                                       
Mary 4 21640 US APAC Open +1 555 9901                                                                                          
;;;;                                                                                                                           
run;quit;                                                                                                                      
                                                                                                                               
data meta;                                                                                                                     
input (VARIABLE ORDER SOURCE) (: $8.);                                                                                         
cards4;                                                                                                                        
Name 1 S_Name                                                                                                                  
ID 2 S_ID                                                                                                                      
Region 3 S_Region                                                                                                              
;;;;                                                                                                                           
run;quit;                                                                                                                      
                                                                                                                               
WORK.HAVE total obs=4                                                                                                          
                                                                                                                               
  S_NAME    S_ID    S_DATE    S_LOCATION    S_REGION    S_COMMENTS        S_TEL                                                
                                                                                                                               
   Bill      1      21550         UK          EMEA       None         +44 20 999 999                                           
   Adam      2      21581         UK          EMEA       Closing      +44 20 999 998                                           
   Sean      3      21609         ES          EMEA       Open         +34 01 889 887                                           
   Mary      4      21640         US          APAC       Open         +1 555 9901                                              
                                                                                                                               
                                                                                                                               
WORK.META total obs=3                                                                                                          
                                                                                                                               
  VARIABLE    ORDER    SOURCE                                                                                                  
                                                                                                                               
   Name         1      S_Name                                                                                                  
   ID           2      S_ID                                                                                                    
   Region       3      S_Region                                                                                                
                                                                                                                               
                                                                                                                               
*            _               _                                                                                                 
  ___  _   _| |_ _ __  _   _| |_                                                                                               
 / _ \| | | | __| '_ \| | | | __|                                                                                              
| (_) | |_| | |_| |_) | |_| | |_                                                                                               
 \___/ \__,_|\__| .__/ \__,_|\__|                                                                                              
                |_|                                                                                                            
;                                                                                                                              
                                                                                                                               
                                                                                                                               
WORK.WANT total obs=4          | RULES                                                                                         
                               | =====                                                                                         
  S_NAME    S_ID    S_REGION   |                                                                                               
                               | Only keep the variables in source table defined                                               
   Bill      1        EMEA     | in the meta data and in the correct order                                                     
   Adam      2        EMEA     |                                                                                               
   Sean      3        EMEA     |                                                                                               
   Mary      4        APAC     |                                                                                               
                                                                                                                               
*                                                                                                                              
 _ __  _ __ ___   ___ ___  ___ ___                                                                                             
| '_ \| '__/ _ \ / __/ _ \/ __/ __|                                                                                            
| |_) | | | (_) | (_|  __/\__ \__ \                                                                                            
| .__/|_|  \___/ \___\___||___/___/                                                                                            
|_|                                                                                                                            
;                                                                                                                              
                                                                                                                               
%symdel sourcen ordern / nowarn;                                                                                               
                                                                                                                               
%array(source,data=meta,var=source);                                                                                           
                                                                                                                               
data want;                                                                                                                     
                                                                                                                               
  retain                                                                                                                       
    %do_over(source,phrase=?);                                                                                                 
                                                                                                                               
  set have;                                                                                                                    
                                                                                                                               
  keep                                                                                                                         
    %do_over(source,phrase=?);                                                                                                 
                                                                                                                               
run;quit;                                                                                                                      

utl-using-meta-data-to-create-customized-sas-tables-do-over'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.