Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$last_4_chars = "0001"; @all_stores = qw("24","25"); foreach $store(@all_stores) { #This sas file will seperate the datasets by stores #Opens file to write to die("Cannot open weekly_$store_pdf.sas to read from ") unless(open(FINAL, ">weekly_$store_pdf.sas")); $prep_pdf = "libname bce '/cdw/dept/dss/home_dir/s006258/BCE';\n". "proc sql;\n". "SELECT FILEDATE,RPTSTORE,RPTTEAM,FIRSTNAME,LASTNAME,WTDTRAN, \n". " WTDOFFERS,WTDAPPS, substr(WTDOFFERS/WTDAPPS,0,5) as WTD_RATE, +\n". " (case\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) >= 1. +2 then 'G'\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) <= 1. +2 and\n". " (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) >= + .65 then 'Y'\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) < .65 + then 'R'\n". " end) as WTD_Color \n". " MTDTRAN,MTDOFFERS,MTDAPPS, substr(MTDOFFERS/MTDAPPS,0,5) as M +TD_RATE,\n". " (case\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) >= 1. +2 then 'G'\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) <= 1. +2 and\n". " (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) >= + .65 then 'Y'\n". " when (substr(sum(WTDAPPS)/sum(WTDOFFERS),0,4)*100) < .65 + then 'R'\n". " end) as MTD_Color\n". "FROM bce.yearly_g$last_4_charsv00\n". "WHERE RPTSTORE = $store\n". "Order by RPTTEAM"; print FINAL "$prep_pdf"; close(FINAL); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing to file
by philcrow (Priest) on Jul 12, 2006 at 17:36 UTC | |
|
Re: Printing to file
by ikegami (Patriarch) on Jul 12, 2006 at 17:49 UTC | |
by Anonymous Monk on Jul 12, 2006 at 17:54 UTC | |
by ikegami (Patriarch) on Jul 12, 2006 at 17:56 UTC | |
by Anonymous Monk on Jul 12, 2006 at 17:59 UTC | |
|
Re: Printing to file
by samtregar (Abbot) on Jul 12, 2006 at 17:32 UTC | |
by Anonymous Monk on Jul 12, 2006 at 17:38 UTC | |
|
Re: Printing to file
by runrig (Abbot) on Jul 12, 2006 at 17:38 UTC | |
by Anonymous Monk on Jul 12, 2006 at 17:49 UTC | |
by runrig (Abbot) on Jul 12, 2006 at 17:53 UTC | |
by duckyd (Hermit) on Jul 12, 2006 at 17:54 UTC | |
by Yunus (Novice) on Jul 14, 2006 at 01:28 UTC | |
|
Re: Printing to file
by jwkrahn (Abbot) on Jul 12, 2006 at 20:00 UTC | |
|
Re: Printing to file
by perl_devel (Friar) on Jul 13, 2006 at 09:06 UTC | |
|
Re: Printing to file
by Yunus (Novice) on Jul 14, 2006 at 01:18 UTC |