I don't know how the COBOL calls to PL/SQL packages work, so I assume that
what you gave in your example is correct, that is, I assume that it is
possible to call a pl/sql procedure from COBOL.

What I will show below is not a solution to your specific problem, but it
should illustrate some principles that you can apply.

For example, you said "I need to format billdate from 090701 to CCYYMMDD so
I can see if they are between from-thru.". This is not true. Instead, use
the DATE datatype.

Here's my example, hope it helps.
PROCEDURE getmbrhist(
   p_mbrsep     IN       mbrhistdetl.mbrsep%TYPE,
   p_option     IN       VARCHAR2,
   p_fromdate   IN       NUMBER,
   p_thrudate   IN       NUMBER,
   p_location   OUT      VARCHAR2,
   p_kwh        OUT      VARCHAR2,
   p_slkwh      OUT      VARCHAR2,
   p_status     OUT      NUMBER )
AS
   v_from_date                   DATE;
   v_thru_date                   DATE;
BEGIN
   v_from_date                := TO_DATE( p_fromdate, 'yymmdd' );
   v_thru_date                := TO_DATE( p_fromdate, 'yymmdd' );

   IF p_option = 1
   THEN
      IF v_from_date < v_thru_date
      THEN
         p_location                 := 'here';
      ELSE
         p_location                 := 'there';
      END IF;
   ELSE
      IF v_from_date BETWEEN v_thru_date AND SYSDATE
      THEN
         p_location                 := 'Denver';
      ELSE
         p_location                 := 'Mars';
      END IF;
   END IF;
END;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to