<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729654#M227107</link>
    <description>DONT KNOW WHICH DATE FORMAT WIL BE USED, AND HOW TO GET THE TOTAL FOR EACH CUSTOMER</description>
    <pubDate>Sun, 28 Mar 2021 18:36:40 GMT</pubDate>
    <dc:creator>NITYA0411</dc:creator>
    <dc:date>2021-03-28T18:36:40Z</dc:date>
    <item>
      <title>Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729652#M227105</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;                                                                                                                                                                                                                                                 
DATA ACCT;                                                                                                                                                                                                                                         
INPUT ACCOUNT_ID ACCOUNT_TYPE$ BALANCE$ BALANCEDATE DATE9.;                                                                                                                                                                                        
FORMAT BALANCEDATE DATE9.;                                                                                                                                                                                                                         
DATALINES;                                                                                                                                                                                                                                         
123 CHEQUING $234 30-NOV-20                                                                                                                                                                                                                        
234 CHEQUING $100 30-NOV-20                                                                                                                                                                                                                        
321 SAVING $150 30-NOV-20                                                                                                                                                                                                                          
456 CHEQUING $10,000 30-NOV-20                                                                                                                                                                                                                     
678 CARD $435 30-NOV-20                                                                                                                                                                                                                            
789 INVESTMENT $999 31-OCT-20                                                                                                                                                                                                                      
123 CHEQUING $155 31-OCT-20                                                                                                                                                                                                                        
234 CHEQUING $67 31-OCT-20                                                                                                                                                                                                                         
321 SAVING $0 31-OCT-20                                                                                                                                                                                                                            
456 CHEQUING $1,000 31-OCT-20                                                                                                                                                                                                                      
234 CHEQUING $500 30-SEP-20                                                                                                                                                                                                                        
321 SAVING $250 30-SEP-20                                                                                                                                                                                                                          
;                                                                                                                                                                                                                                                  
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
DATA ACCTXREF;                                                                                                                                                                                                                                     
INPUT ACCOUNT_ID CUSTOMER_ID ACCOUNT_MONTH DATE9.;                                                                                                                                                                                                 
FORMAT ACCOUNT_MONTH DATE9.;                                                                                                                                                                                                                       
DATALINES;                                                                                                                                                                                                                                         
123 3010 30-NOV-20                                                                                                                                                                                                                                 
234 3010 30-NOV-20                                                                                                                                                                                                                                 
234 8788 30-NOV-20                                                                                                                                                                                                                                 
321 4556 30-NOV-20                                                                                                                                                                                                                                 
456 6789 30-NOV-20                                                                                                                                                                                                                                 
678 4510 30-NOV-20                                                                                                                                                                                                                                 
789 3319 30-NOV-20                                                                                                                                                                                                                                 
123 3010 31-OCT-20                                                                                                                                                                                                                                 
234 3010 31-OCT-20                                                                                                                                                                                                                                 
234 8788 31-OCT-20                                                                                                                                                                                                                                 
321 4556 31-OCT-20                                                                                                                                                                                                                                 
456 6789 31-OCT-20                                                                                                                                                                                                                                 
234 3010 30-SEP-20                                                                                                                                                                                                                                 
234 8788 30-SEP-20                                                                                                                                                                                                                                 
321 4556 30-SEP-20                                                                                                                                                                                                                                 
;                                                                                                                                                                                                                                                  
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                   
PROC SORT DATA=ACCT;                                                                                                                                                                                                                               
BY ACCOUNT_ID;                                                                                                                                                                                                                                     
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
PROC SORT DATA=ACCTXREF;                                                                                                                                                                                                                           
BY ACCOUNT_ID;                                                                                                                                                                                                                                     
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
DATA MERG;                                                                                                                                                                                                                                         
MERGE ACCT ACCTXREF(RENAME=(ACCOUNT_MONTH=BALANCEDATE));                                                                                                                                                                                           
BY ACCOUNT_ID;                                                                                                                                                                                                                                     
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
 DATA TASK1;                                                                                                                                                                                                                                       
SET MERG;                                                                                                                                                                                                                                          
WHERE ACCOUNT_TYPE IN("CHEQUING","SAVING");                                                                                                                                                                                                        
WHERE ALSO BALANCEDATE='30NOV-20'D;                                                                                                                                                                                                                
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
PROC SORT DATA=TASK1;                                                                                                                                                                                                                              
BY CUSTOMER_ID;                                                                                                                                                                                                                                    
RUN;                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                   
DATA TASK_1;                                                                                                                                                                                                                                       
SET TASK1;                                                                                                                                                                                                                                         
BY CUSTOMER_ID;                                                                                                                                                                                                                                    
IF FIRST.CUSTOMER_ID=1 THEN TOTAL_BALANCE=BALANCE;                                                                                                                                                                                                 
ELSE TOTAL_BALANCE=BALANCE+TOTAL_BALANCE;                                                                                                                                                                                                          
RUN;        &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Mar 2021 18:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729652#M227105</guid>
      <dc:creator>NITYA0411</dc:creator>
      <dc:date>2021-03-28T18:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729653#M227106</link>
      <description>Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a dataset showing the total balance in chequing and savings accounts for each customer on November 30, 2020.&lt;BR /&gt;&lt;BR /&gt;THIS IS THE QUESTION</description>
      <pubDate>Sun, 28 Mar 2021 18:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729653#M227106</guid>
      <dc:creator>NITYA0411</dc:creator>
      <dc:date>2021-03-28T18:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729654#M227107</link>
      <description>DONT KNOW WHICH DATE FORMAT WIL BE USED, AND HOW TO GET THE TOTAL FOR EACH CUSTOMER</description>
      <pubDate>Sun, 28 Mar 2021 18:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729654#M227107</guid>
      <dc:creator>NITYA0411</dc:creator>
      <dc:date>2021-03-28T18:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729663#M227115</link>
      <description>&lt;P&gt;&lt;STRONG&gt;DON'T YELL. &lt;/STRONG&gt;All capital letters is yelling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First thing, your date values are NOT in date9. format, date9. is ddMONyyyy, 4 digit year and no dashes.&lt;/P&gt;
&lt;P&gt;I would suggest using 4 digit years in anything but there are people that did not spend hours fixing year 2000 in data set that failed to learn the lesson.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are you merging those data sets when there is not a stated requirement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc summary or means with CLASS or by statement will sum variables. I would say your real question is how to just get the specific types of accounts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc summary data=acct nway;
   class account_id balancedate;
   where account_type in ('CHEQUING' 'SAVING');
   var balance;
   output out=want sum=;
run;&lt;/PRE&gt;
&lt;P&gt;will sum the value of balance for the types of accounts in the Where statement for each combination of account_id and balancedate.&lt;/P&gt;
&lt;P&gt;You could add a specific value or range of values for balancedate to the Where statment. Left as an exercise so you learn something at this point.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 14:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729663#M227115</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-29T14:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729669#M227120</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;Thank you for your response. I really appreciate it.&lt;BR /&gt;Tried using proc summary, but showing this error.&lt;BR /&gt;ERROR: Variable BALANCE in list does not match type prescribed for this&lt;BR /&gt;list.&lt;BR /&gt;</description>
      <pubDate>Sun, 28 Mar 2021 22:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729669#M227120</guid>
      <dc:creator>NITYA0411</dc:creator>
      <dc:date>2021-03-28T22:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Question 1: Using SAS code (proc sql, data steps, any other functions and procedures), create a</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729677#M227126</link>
      <description>&lt;LI-CODE lang="sas"&gt;input ACCOUNT_ID ACCOUNT_TYPE $ BALANCE $ BALANCEDATE date9.;                                                                                                                                                                                        
&lt;/LI-CODE&gt;
&lt;P&gt;tells SAS that BALANCE is a string.&lt;/P&gt;
&lt;P&gt;So you need to fix this informat as well (as in: on top of fixing the date informat).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 02:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-1-Using-SAS-code-proc-sql-data-steps-any-other/m-p/729677#M227126</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-03-29T02:02:41Z</dc:date>
    </item>
  </channel>
</rss>

