<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SQR Evaluate Versus C/Java Switch, Part J*</title>
	<atom:link href="http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/feed/" rel="self" type="application/rss+xml" />
	<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/</link>
	<description>When Peoplebooks Is Not Enough</description>
	<lastBuildDate>Mon, 12 Jul 2010 20:20:25 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-322</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Thu, 30 Apr 2009 22:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-322</guid>
		<description>This is an interesting problem that would probably make use of the SQL case and decode functions.  I&#039;m busy working on assignments that my employer pays me to do, and on the next blog entry.  Would anyone like to take this on?</description>
		<content:encoded><![CDATA[<p>This is an interesting problem that would probably make use of the SQL case and decode functions.  I&#8217;m busy working on assignments that my employer pays me to do, and on the next blog entry.  Would anyone like to take this on?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kishore</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-315</link>
		<dc:creator>kishore</dc:creator>
		<pubDate>Wed, 29 Apr 2009 17:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-315</guid>
		<description>Hello....i do not know SQR...but i need to change SQR to SQL...please help me out...ty...

IF PS_C_VCHR_CNTL_STG.ACCOUNTING_DT = $NULL_DT
    EVALUATE PS_ORIGIN_AP_OPT.ACCOUNTING_DT_IND
      WHEN = &#039;D&#039;
        EVALUATE PS_BUS_UNIT_OPT_AP.ACCOUNTING_DT_IND

          WHEN = &#039;S&#039;
            MOVE PS_BUS_UNIT_OPT_AP.ACCOUNTING_DT TO $ACCOUNTING_DT

          WHEN = &#039;C&#039;
            MOVE PS_C_CYCLE_TBL.C_CYCLE_DT        TO $ACCOUNTING_DT
        END-EVALUATE

      WHEN = &#039;S&#039;
        MOVE PS_ORIGIN_AP_OPT.ACCOUNTING_DT       TO $ACCOUNTING_DT
      WHEN = &#039;C&#039;
        MOVE PS_C_CYCLE_TBL.C_CYCLE_DT            TO $ACCOUNTING_DT
    END-EVALUATE
ELSE
    MOVE PS_C_VCHR_CNTL_STG.ACCOUNTING_DT         TO $ACCOUNTING_DT
    IF PS_C_VCHR_HDR_STG.ACCOUNTING_DT &gt; $ACCOUNTING_DT
       MOVE PS_C_VCHR_HDR_STG.ACCOUNTING_DT        TO $ACCOUNTING_DT
    END-IF
    IF $ACCOUNTING_DT &lt;= PS_C_CYCLE_TBL.C_CYCLE_DT

       SELECT B.OPEN_PERIOD_FROM
         FROM PS_C_MONTH_TBL A, PS_BU_LED_GRP_TBL B
        WHERE B.BUSINESS_UNIT    = $BUSINESS_UNIT
          AND B.LEDGER_GROUP     = &#039;ACTUALS&#039;
          AND B.OPEN_YEAR_FROM   = A.YEAROFDATE
          AND B.OPEN_PERIOD_FROM &lt;= A.MONTHOFDATE
          AND $ACCOUNTING_DT BETWEEN A.FROM_DATE AND A.THRU_DATE

       IF $PERIOD_OPEN_FOUND  = ‘N’
          SELECT MON.FROM_DATE
            FROM PS_C_MONTH_TBL MON
           WHERE MON.YEAROFDATE  = #YEAR of C_CYCLE_DT
             AND C_CYCLE_DT BETWEEN MON.FROM_DATE AND MON.THRU_DATE
       END-IF
    END-IF
END-IF

i need to change to sql....thanks in advance</description>
		<content:encoded><![CDATA[<p>Hello&#8230;.i do not know SQR&#8230;but i need to change SQR to SQL&#8230;please help me out&#8230;ty&#8230;</p>
<p>IF PS_C_VCHR_CNTL_STG.ACCOUNTING_DT = $NULL_DT<br />
    EVALUATE PS_ORIGIN_AP_OPT.ACCOUNTING_DT_IND<br />
      WHEN = &#8216;D&#8217;<br />
        EVALUATE PS_BUS_UNIT_OPT_AP.ACCOUNTING_DT_IND</p>
<p>          WHEN = &#8216;S&#8217;<br />
            MOVE PS_BUS_UNIT_OPT_AP.ACCOUNTING_DT TO $ACCOUNTING_DT</p>
<p>          WHEN = &#8216;C&#8217;<br />
            MOVE PS_C_CYCLE_TBL.C_CYCLE_DT        TO $ACCOUNTING_DT<br />
        END-EVALUATE</p>
<p>      WHEN = &#8216;S&#8217;<br />
        MOVE PS_ORIGIN_AP_OPT.ACCOUNTING_DT       TO $ACCOUNTING_DT<br />
      WHEN = &#8216;C&#8217;<br />
        MOVE PS_C_CYCLE_TBL.C_CYCLE_DT            TO $ACCOUNTING_DT<br />
    END-EVALUATE<br />
ELSE<br />
    MOVE PS_C_VCHR_CNTL_STG.ACCOUNTING_DT         TO $ACCOUNTING_DT<br />
    IF PS_C_VCHR_HDR_STG.ACCOUNTING_DT &gt; $ACCOUNTING_DT<br />
       MOVE PS_C_VCHR_HDR_STG.ACCOUNTING_DT        TO $ACCOUNTING_DT<br />
    END-IF<br />
    IF $ACCOUNTING_DT &lt;= PS_C_CYCLE_TBL.C_CYCLE_DT</p>
<p>       SELECT B.OPEN_PERIOD_FROM<br />
         FROM PS_C_MONTH_TBL A, PS_BU_LED_GRP_TBL B<br />
        WHERE B.BUSINESS_UNIT    = $BUSINESS_UNIT<br />
          AND B.LEDGER_GROUP     = &#8216;ACTUALS&#8217;<br />
          AND B.OPEN_YEAR_FROM   = A.YEAROFDATE<br />
          AND B.OPEN_PERIOD_FROM &lt;= A.MONTHOFDATE<br />
          AND $ACCOUNTING_DT BETWEEN A.FROM_DATE AND A.THRU_DATE</p>
<p>       IF $PERIOD_OPEN_FOUND  = ‘N’<br />
          SELECT MON.FROM_DATE<br />
            FROM PS_C_MONTH_TBL MON<br />
           WHERE MON.YEAROFDATE  = #YEAR of C_CYCLE_DT<br />
             AND C_CYCLE_DT BETWEEN MON.FROM_DATE AND MON.THRU_DATE<br />
       END-IF<br />
    END-IF<br />
END-IF</p>
<p>i need to change to sql&#8230;.thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-111</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Fri, 27 Feb 2009 17:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-111</guid>
		<description>You&#039;re welcome.  And I hope you&#039;ll say something more on your next comment; I&#039;m trying to foster a discussion about SQR.</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome.  And I hope you&#8217;ll say something more on your next comment; I&#8217;m trying to foster a discussion about SQR.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AdvandyBainia</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-109</link>
		<dc:creator>AdvandyBainia</dc:creator>
		<pubDate>Fri, 27 Feb 2009 10:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-109</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: administrator</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-50</link>
		<dc:creator>administrator</dc:creator>
		<pubDate>Fri, 06 Feb 2009 23:07:04 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-50</guid>
		<description>You forget, Peoplesoft also has financial, manufacturing, customer relations, and student administration software.</description>
		<content:encoded><![CDATA[<p>You forget, Peoplesoft also has financial, manufacturing, customer relations, and student administration software.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-43</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Mon, 02 Feb 2009 23:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-43</guid>
		<description>I&#039;ll try the brain teaser...

The following can jump with return to either the same or next line:
do
print (and the implied print on a database column listed in a SELECT)
print-image, print-chart
position
graphic box/horz-line/vert-line
next-listing, next-column, new-page, new-report
page-number, last-page, date-time
begin-document
connect
execute
end-program, end-report

The following can jump with a return to some point nearby (but not the next line):
begin-select (also listed below)
begin-sql

The following can jump without the possibility of return:
goto
when, when-other (evaluate)
if, else
while
break
exit-select
end-procedure, end-heading, end-footing
end-while
begin-select
end-select (or really the &quot;from&quot; line in the SQL)</description>
		<content:encoded><![CDATA[<p>I&#8217;ll try the brain teaser&#8230;</p>
<p>The following can jump with return to either the same or next line:<br />
do<br />
print (and the implied print on a database column listed in a SELECT)<br />
print-image, print-chart<br />
position<br />
graphic box/horz-line/vert-line<br />
next-listing, next-column, new-page, new-report<br />
page-number, last-page, date-time<br />
begin-document<br />
connect<br />
execute<br />
end-program, end-report</p>
<p>The following can jump with a return to some point nearby (but not the next line):<br />
begin-select (also listed below)<br />
begin-sql</p>
<p>The following can jump without the possibility of return:<br />
goto<br />
when, when-other (evaluate)<br />
if, else<br />
while<br />
break<br />
exit-select<br />
end-procedure, end-heading, end-footing<br />
end-while<br />
begin-select<br />
end-select (or really the &#8220;from&#8221; line in the SQL)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-42</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Mon, 02 Feb 2009 18:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-42</guid>
		<description>Oh, and one other thing: don&#039;t forget Towers of Hanoi as a classic example of recursion. Surely, every HR department needs a good Towers of Hanoi implementation, eh?</description>
		<content:encoded><![CDATA[<p>Oh, and one other thing: don&#8217;t forget Towers of Hanoi as a classic example of recursion. Surely, every HR department needs a good Towers of Hanoi implementation, eh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-41</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Mon, 02 Feb 2009 18:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-41</guid>
		<description>Holy tool misuse, Batman!

First, the switch example with counting letters: yeah, it&#039;ll work, but if I caught a C programmer writing that code, I&#039;d have him shot. I realize, of course, that you&#039;re not necessarily advocating people write code like that, but you&#039;re using it as an example of what is possible.

Next, the example of opening files, which seems less contrived than the letter counting: you&#039;re right that a C switch statement can&#039;t handle it, but is that such a bad thing? Your scenario has a logical flow of steps, so why not let that shine through in the code by using &#039;if&#039; statements - even in SQR?

And yet, I have to admit that&#039;s a real nifty use of the evaluate. By giving &#039;evaluate&#039; a constant of 0, and letting the &#039;when&#039; statements do more work, it&#039;s like turning a switch statement inside-out. Very cool (regardless of whether it&#039;s good programming style or not).

Your other examples are also intriguing uses of &#039;evaluate&#039;. I&#039;m tempted to respond to them by saying &quot;hey, that&#039;s easy to do in C; you just wouldn&#039;t use a switch statement to do it&quot;. But of course, you&#039;re not the one who originally likened &#039;evaluate&#039; to &#039;switch&#039;; the SQR manual did that.

So your point that evaluate has very different abilities than switch is well taken and well supported. Nice article, Steve!

- Bob</description>
		<content:encoded><![CDATA[<p>Holy tool misuse, Batman!</p>
<p>First, the switch example with counting letters: yeah, it&#8217;ll work, but if I caught a C programmer writing that code, I&#8217;d have him shot. I realize, of course, that you&#8217;re not necessarily advocating people write code like that, but you&#8217;re using it as an example of what is possible.</p>
<p>Next, the example of opening files, which seems less contrived than the letter counting: you&#8217;re right that a C switch statement can&#8217;t handle it, but is that such a bad thing? Your scenario has a logical flow of steps, so why not let that shine through in the code by using &#8216;if&#8217; statements &#8211; even in SQR?</p>
<p>And yet, I have to admit that&#8217;s a real nifty use of the evaluate. By giving &#8216;evaluate&#8217; a constant of 0, and letting the &#8216;when&#8217; statements do more work, it&#8217;s like turning a switch statement inside-out. Very cool (regardless of whether it&#8217;s good programming style or not).</p>
<p>Your other examples are also intriguing uses of &#8216;evaluate&#8217;. I&#8217;m tempted to respond to them by saying &#8220;hey, that&#8217;s easy to do in C; you just wouldn&#8217;t use a switch statement to do it&#8221;. But of course, you&#8217;re not the one who originally likened &#8216;evaluate&#8217; to &#8217;switch&#8217;; the SQR manual did that.</p>
<p>So your point that evaluate has very different abilities than switch is well taken and well supported. Nice article, Steve!</p>
<p>- Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Josephson</title>
		<link>http://peoplesoftsqr.com/index.php/2009/02/sqr-evaluate-versus-cjava-switch-part-j/comment-page-1/#comment-40</link>
		<dc:creator>Bob Josephson</dc:creator>
		<pubDate>Mon, 02 Feb 2009 18:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://peoplesoftsqr.com/?p=154#comment-40</guid>
		<description>This should be Part K. The J did not exist in the Roman alphabet.</description>
		<content:encoded><![CDATA[<p>This should be Part K. The J did not exist in the Roman alphabet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
