ssa1='CUSTOMER(SSNUMBER ='||ssn||')';
CUSTOMER(SSNUMBER =303-46-4887)
newdate=put(datevalu,date7.);
newdate='20APR64'
maxamt=500; ssa1='WIRETRAN(WIREAMMT <'||put(maxamt,pd5.2)||')';
data _null_; 1 tday = today(); 2 d = day(tday); m = month(tday); y = year(tday); 3 if d = 31 then if m = 5 or m = 7 or m = 10 or m = 12 then d = 30; 4 if m = 3 then if d < 28 then d = 28; if m = 1 then do; m = 12; y = y - 1; end; else m = m - 1; 5 datpmon = mdy(m,d,y); 6 datem31 = tday - 31; 7 ssa1 = 'CHCKACCT (STMTDATE= ' || put(datpmon,mmddyy6.) || '| STMTDATE> ' || put(datem31,mmddyy6.) || ')'; stop; run;
1 | Use the SAS function TODAY to produce the current date as a SAS date value and assign it to the variable TDAY. |
2 | Use the SAS functions DAY, MONTH, and YEAR to extract the corresponding parts of the current date and assign them to appropriate variables. |
3 | Modify D values to adjust when previous month has fewer than 31 days. |
4 | Modify the month variable (M) to contain the prior month value. |
5 | Assign the SAS date value for last month, the same day as today, to the variable DATPMON. |
6 | Subtract 31 from the SAS date representing today's date and assign the value to the variable DATEM31. |
7 | To build the SSA, concatenate these elements:
If these statements
are executed on 28 March 1995, the value of SSA1 is
CHCKACCT(STMTDATE
=02/28/95|STMTDATE >02/28/95) |
data _null_; set ver6.newaddr; length ssa1 $31; infile acctsam dli ssa=ssa1 call=func status=st pcbno=4; ssa1 = 'CUSTOMER(SSN =' || ssn || ')'; func = 'GHU '; input; if st = ' ' then do; func = 'REPL'; ssa1 = ' '; file acctsam dli; put _infile_ @; put @52 newaddr1 $char30. @82 newaddr2 $char30. @112 newcity $char28. @140 newstate $char2. @162 newzip $char10.; if st ¬= ' ' then link abendit; end; else if st = 'GE' then do; _error_ = 0; stop; end; else link abendit; return; abendit: file log; put _all_; abort; run;