× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I've tried the code below, and it formats fine. I get the outline.

However; if I use the following inside the select statement...

exec sql
SELECT *
FROM demo_table
ORDER BY
CASE
WHEN gpieff < gpican THEN gpieff
ELSE gpican
END;

The parser fails.

Please open a support case so we can get an APAR for this. We have opened a Jira along with the failing example.

As a work around, you can create a field called inRange, assign it the complex date range and use the when inRange. The code will properly format then.

Example:

dcl-s inRange ind;

inRange = %date in %range(gpieff:gpican)
or (%date >= gpieff and gpican = *loval);

select;
when inRange;
exec sql
SELECT *
FROM demo_table
ORDER BY
CASE
WHEN gpieff < gpican THEN gpieff
ELSE gpican
END;
...

Steve Ferrell
Principal Software Engineer Lead RDi
Fortra, the new face of HelpSystems


Here's the current code:
select;
when %date in %range(gpieff:gpican) //Between effective
and cancel
or (%date >= gpieff and gpican = *loval); //Past effective, no
cancel (perpetual)
//Currently effective (make row pink)

when %date < gpieff; //Effective in the
future
//Not effective yet (make row blue)

other; //Everything else
//Expired (no color/stay green)

endsl;

Using this logic with a tweak and an ORDER BY CASE construct, you can push all your effective transactions to the beginning of the data. Many customers like having current data at the beginning of the subfile.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.