Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Order= syntax in Proc Report

Posts: 1

Order= syntax in Proc Report

In the below code, I’m needing to sort descending on the value of “QTY Redeemed” when I export to excel.  Within SAS, my data is sorted (reflected in the apnd5198 table I call out) but while the data successfully exports the report to excel, my data is not sorted. I have tried every variation of “order=internal” , “order order=internal” , “order=internal descending” , “order=data” , & etc, & etc that I could think of, and placed the command through my code, but my data un excel will not sort!  Would anyone be able to help me with this syntax? 

proc report data=apnd5198 out=rep1

style(report) = {font_size = 8pt cellpadding = 2pt}

style(column) = {background=white}

STYLE(header) = {BACKGROUND = lightblue FONT_WEIGHT=bold};

column mailer_name description QTY_Redeemed Total_Value qty_mailed Coupon_Redemption_Rate;

define mailer_name /group "Campaign" style (column) = {cellwidth=300px};

define description /group "Coupon" style (column) = {cellwidth=525px};

define QTY_Redeemed / order=internal analysis "QTY Redeemed" style (column) = {cellwidth=150px} style(column) = {tagattr='format:#,###'};

define Total_Value /analysis "Total Value" style (column) = {cellwidth=150px} style(column) = {tagattr='format:$#,###'};

define qty_mailed /analysis noprint;

define Coupon_Redemption_Rate /computed "Coupon Redemption Rate" style (column) = {cellwidth=150px} style(column) = {tagattr='format:0.00%'};

compute Coupon_Redemption_Rate; Coupon_Redemption_Rate = QTY_Redeemed.sum / qty_mailed.sum; endcomp;

break after mailer_name / summarize;

Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation