<?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: Sort Initialization Failure - PROC SQL in SAS EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421291#M27119</link>
    <description>&lt;P&gt;The issue has been solved.&amp;nbsp; I did not have all of my left joins on a single driving table as I was experimenting with different ways to bring the data together.&amp;nbsp; Now that all left joins reference the same driver table, it works.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2017 18:40:21 GMT</pubDate>
    <dc:creator>sasspan</dc:creator>
    <dc:date>2017-12-14T18:40:21Z</dc:date>
    <item>
      <title>Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421252#M27109</link>
      <description>&lt;P&gt;Hello -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a 2400 line program within SAS EG program.&amp;nbsp; The code runs until the very last step where I connect 38 tables through left outer joins.&amp;nbsp; I had some issues with the joins at first, but they have been corrected.&amp;nbsp; The only error I am getting now is "Sort Initialization Failure."&amp;nbsp; I have tried setting the SORTSIZE option to 0, and I also tried the MEMSIZE but can't get that one to work.&amp;nbsp; It throws a warning for MEMSIZE only works at the beginning of a session.&amp;nbsp; I tried to log out and log back in and run the MEMSIZE first, and still get the same error.&amp;nbsp; Any thoughts on the sort initialization failure error would be great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421252#M27109</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2017-12-14T17:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421262#M27111</link>
      <description>&lt;P&gt;Is that 38 joins in a single Proc Sql call? Are all of the joins on the same variable or do you have different variables on different joins?&lt;/P&gt;
&lt;P&gt;There is a "hidden" sort involved with the joins and if you have different variables then the internal attempts to maintain different orders on one of the sets might be an issue.&lt;/P&gt;
&lt;P&gt;If the joins are all on the same variables it may be worth sorting all of them first (or explicitly order them in previous steps)&amp;nbsp;to reduce overhead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or reduce the scale by only doing a few joins per Proc SQL call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might post the code of that join so we can make specific suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421262#M27111</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-14T17:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421263#M27112</link>
      <description>&lt;P&gt;Bummer!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm going out on a limb here, as I have no way to verify anything, but I'm pretty sure that SORT routines will use disk overflow if memory fills up. I suggest you check the disk area being used for work and utilities, and make sure there's lots of space available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421263#M27112</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-12-14T17:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421267#M27114</link>
      <description>&lt;P&gt;I posted a "quick reply" but it isn't showing up on my computer, so I'm posting a regular reply...sorry if I am being redundant.&amp;nbsp; I don't think it has to do with ordering the variables in previous steps as SQL does this for you, unlike SAS.&amp;nbsp; They are all the same variable, just different tables.&amp;nbsp; I may try your approach of breaking it up into smaller proc sqls, I like that.&amp;nbsp; Here's the code for review -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table pmsi_tst.phase_1_variables_final as&lt;BR /&gt;select &lt;BR /&gt;a.cl_claim_number,&lt;BR /&gt;b.tramadol_400,&lt;BR /&gt;c.opioid_benz_sed_stim,&lt;BR /&gt;d.opioid_benz,&lt;BR /&gt;e.opioid_carisoprodol,&lt;BR /&gt;f.opioid_benz_smr,&lt;BR /&gt;g.stim_sed,&lt;BR /&gt;h.apap_4k,&lt;BR /&gt;i.triazolam_LT,&lt;BR /&gt;j.tempazepam_LT,&lt;BR /&gt;k.rozerem_LT,&lt;BR /&gt;l.quazepam_LT,&lt;BR /&gt;m.flurazepam_LT,&lt;BR /&gt;n.eszopiclone_LT,&lt;BR /&gt;o.estazolam_LT,&lt;BR /&gt;p.zaleplon_LT,&lt;BR /&gt;q.new_york_brand,&lt;BR /&gt;r.narc_20_days,&lt;BR /&gt;s.polypharmacy,&lt;BR /&gt;t.chronic_cyclo,&lt;BR /&gt;u.chronic_zolpidem,&lt;BR /&gt;v.narc_42_days,&lt;BR /&gt;w.narc_60_days,&lt;BR /&gt;x.opioid_60_doi,&lt;BR /&gt;y.narc_30_days,&lt;BR /&gt;z.smr_6_weeks,&lt;BR /&gt;aa.benzo_30_days,&lt;BR /&gt;bb.opioid_3_plus_last_30,&lt;BR /&gt;cc.chronic_narc,&lt;BR /&gt;dd.first_narc_trigger,&lt;BR /&gt;ee.chronic_smr,&lt;BR /&gt;gg.first_narc_10_ds_trig,&lt;BR /&gt;ii.new_long_narc,&lt;BR /&gt;jj.mult_narc_docs,&lt;BR /&gt;jj.mult_pharm,&lt;BR /&gt;jj.mult_docs,&lt;BR /&gt;jj.narc_3_or_more,&lt;BR /&gt;jj.dupe_smr,&lt;BR /&gt;jj.dupe_nsaid,&lt;BR /&gt;jj.dupe_sed,&lt;BR /&gt;jj.drug_classes_5_plus,&lt;BR /&gt;rr.cl_55_over_1000_billed,&lt;BR /&gt;rr.spend_1500_10k,&lt;BR /&gt;rr.spend_1k_1500,&lt;BR /&gt;rr.spend_500_1k,&lt;BR /&gt;a.age_58_60,&lt;BR /&gt;a.age_60_plus,&lt;BR /&gt;yy.med_0_50,&lt;BR /&gt;yy.med_50_100,&lt;BR /&gt;yy.med_100_150,&lt;BR /&gt;yy.med_over_150,&lt;BR /&gt;a.anti_narcoleptic,&lt;BR /&gt;a.anti_retroviral,&lt;BR /&gt;a.carisoprodol,&lt;BR /&gt;a.narcan,&lt;BR /&gt;a.meperidine,&lt;BR /&gt;a.opemprazole,&lt;BR /&gt;a.terocin,&lt;BR /&gt;a.testosterone,&lt;BR /&gt;a.phys_dispense,&lt;BR /&gt;a.anticonvulsant,&lt;BR /&gt;a.antidepressant,&lt;BR /&gt;a.anti_inflam,&lt;BR /&gt;a.antipsych,&lt;BR /&gt;a.compound,&lt;BR /&gt;a.non_wc_drug,&lt;BR /&gt;a.narc_nonnarc_pain,&lt;BR /&gt;a.opioid,&lt;BR /&gt;a.steroid,&lt;BR /&gt;a.ulcer,&lt;BR /&gt;a.fentanyl,&lt;BR /&gt;a.duexis,&lt;BR /&gt;a.vemovo,&lt;BR /&gt;a.lyrica,&lt;BR /&gt;a.sed_hyp,&lt;BR /&gt;a.percocet,&lt;BR /&gt;a.med5k,&lt;BR /&gt;xx.celebrex_200,&lt;BR /&gt;zz.new_LA_tramadol_trig&lt;BR /&gt;from solo_triggers a&lt;BR /&gt;left join tramadol_over_400 b on a.cl_claim_number = b.cl_claim_number&lt;BR /&gt;left join opioid_benz_sed_stim c on b.cl_claim_number = c.cl_claim_number&lt;BR /&gt;left join opioid_benz d on c.cl_claim_number = d.cl_claim_number&lt;BR /&gt;left join opioid_carisoprodol e on d.cl_claim_number = e.cl_claim_number&lt;BR /&gt;left join opioid_benz_smr f on e.cl_claim_number = f.cl_claim_number&lt;BR /&gt;left join stim_sed g on f.cl_claim_number = g.cl_claim_number&lt;BR /&gt;left join apap_over_4k h on g.cl_claim_number = h.cl_claim_number&lt;BR /&gt;left join triazolam_final i on h.cl_claim_number = i.cl_claim_number&lt;BR /&gt;left join tempazepam_final j on i.cl_claim_number = j.cl_claim_number&lt;BR /&gt;left join rozerem_final k on j.cl_claim_number = k.cl_claim_number&lt;BR /&gt;left join quazepam_final l on k.cl_claim_number = l.cl_claim_number&lt;BR /&gt;left join flurazepam_final m on l.cl_claim_number = m.cl_claim_number&lt;BR /&gt;left join eszopiclone_final n on m.cl_claim_number = n.cl_claim_number&lt;BR /&gt;left join estazolam_final o on n.cl_claim_number = o.cl_claim_number&lt;BR /&gt;left join zaleplon_final p on o.cl_claim_number = p.cl_claim_number&lt;BR /&gt;left join new_york_brand_final q on p.cl_claim_number = q.cl_claim_number&lt;BR /&gt;left join narc_20_days r on q.cl_claim_number = r.cl_claim_number&lt;BR /&gt;left join poly_7 s on r.cl_claim_number = s.cl_claim_number&lt;BR /&gt;left join chronic_cyclo t on s.cl_claim_number = t.cl_claim_number&lt;BR /&gt;left join chronic_zolpidem u on t.cl_claim_number = u.cl_claim_number&lt;BR /&gt;left join narc_42_days v on u.cl_claim_number = v.cl_claim_number&lt;BR /&gt;left join narc_60_days w on v.cl_claim_number = w.cl_claim_number&lt;BR /&gt;left join opioid_60_doi x on w.cl_claim_number = x.cl_claim_number&lt;BR /&gt;left join narc_30_days y on x.cl_claim_number = y.cl_claim_number&lt;BR /&gt;left join smr_6_weeks z on y.cl_claim_number = z.cl_claim_number&lt;BR /&gt;left join benzo_30_days aa on z.cl_claim_number = aa.cl_claim_number&lt;BR /&gt;left join opioids_3_30 bb on aa.cl_claim_number = bb.cl_claim_number&lt;BR /&gt;left join chronic_narc cc on bb.cl_claim_number = cc.cl_claim_number&lt;BR /&gt;left join first_second_opioid_trig dd on cc.cl_claim_number = dd.cl_claim_number&lt;BR /&gt;left join chronic_smr ee on dd.cl_claim_number = ee.cl_claim_number&lt;BR /&gt;left join first_narc_10_trigger gg on ee.cl_claim_number = gg.cl_claim_number&lt;BR /&gt;left join new_la_opioid_trig ii on gg.cl_claim_number = ii.cl_claim_number&lt;BR /&gt;left join multiple_occur_behavior jj on ii.cl_claim_number = jj.cl_claim_number&lt;BR /&gt;left join spend_variables rr on jj.cl_claim_number = rr.cl_claim_number&lt;BR /&gt;left join med_all_claims yy on rr.cl_claim_number = yy.cl_claim_number&lt;BR /&gt;left join celebrex_over_200 xx on yy.cl_claim_number = xx.cl_claim_number&lt;BR /&gt;left join new_la_tramadol_trig zz on xx.cl_claim_number = zz.cl_claim_number;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421267#M27114</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2017-12-14T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421272#M27116</link>
      <description>&lt;P&gt;My replies are not showing up for some reason, I'm thinking it's because of the code being in it, so I'll just add an attachment and see if that works.&amp;nbsp; I don't think it's the ordering of the variables. SQL does this for you.&amp;nbsp; I will try breaking it into diff proc sqls and see if that works.&amp;nbsp; For now, here's the code for your review.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421272#M27116</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2017-12-14T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421287#M27118</link>
      <description>&lt;P&gt;38 tables in one SQL? I'd call that at least a bit optimistic.&lt;/P&gt;
&lt;P&gt;Split that into stages. Depending on the relationships, a series of sort/data steps might even perform better.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 18:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421287#M27118</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-14T18:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sort Initialization Failure - PROC SQL in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421291#M27119</link>
      <description>&lt;P&gt;The issue has been solved.&amp;nbsp; I did not have all of my left joins on a single driving table as I was experimenting with different ways to bring the data together.&amp;nbsp; Now that all left joins reference the same driver table, it works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 18:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sort-Initialization-Failure-PROC-SQL-in-SAS-EG/m-p/421291#M27119</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2017-12-14T18:40:21Z</dc:date>
    </item>
  </channel>
</rss>

