× 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.




Could there be anything in my RPG program causing the error?
=====================================================
H NOMAIN
      *
      * Files Used
FFRP001    IF   E           K DISK
FFRP003    IF   E           K DISK
FAAP050    IF   E           K DISK
FAAL05006  IF   E           K DISK
      *
      * On Time Procedure
D FR47LATEP       PR             1  0
D  FHOT1                              LIKE(FHOT)
D  FHPRO1                             LIKE(FHPRO)
D  FHPUDT1                            LIKE(FHPUDT)
D  FHDADT1                            LIKE(FHDADT)
D  FHDDAT1                            LIKE(FHDDAT)
D  FHSCD1                             LIKE(FHSCD)
D  FHDT1                              LIKE(FHDT)
D  FHCCD1                             LIKE(FHCCD)
D  FHCCT1                             LIKE(FHCCT)
D  FHCST1                             LIKE(FHCST)
D  FHCZIP1                            LIKE(FHCZIP)
      *
      * ----------------------------------------------
      * DS6R330 - External Program to Get Service Days
      * ----------------------------------------------
D  $HOT           S              3  0
D  $HPRO          S              7  0
D  $PUDT          S              8
D  $SCD           S              7
D  $OCITY         S             20
D  $OST           S              2
D  $OZIP          S              6
D  $DT            S              3  0
D  $CCD           S              7
D  $DCITY         S             20
D  $DST           S              2
D  $DZIP          S              6
D  $IO            S              1
D  $ASDF          S              1
D  $DDCF          S              1
D  $PASD          S              1  0
D  $DASD          S              1  0
D  $DELIV         S              8
D  $DAYS          S              3  0
D  $AC            S             30
D  $AD            S              5
D GETSVCDAYS      PR                  EXTPGM('DS6R330')
D  $HOT1                         3  0
D  $HPRO1                        7  0
D  $PUDT1                        8
D  $SCD1                         7
D  $OCITY1                      20
D  $OST1                         2
D  $OZIP1                        6
D  $DT1                          3  0
D  $CCD1                         7
D  $DCITY1                      20
D  $DST1                         2
D  $DZIP1                        6
D  $IO1                          1
D  $ASDF1                        1
D  $DDCF1                        1
D  $PASD1                        1  0
D  $DASD1                        1  0
D  $DELIV1                       8
D  $DAYS1                        3  0
D  $AC1                         30
D  $AD1                          5
      *
      * On Time Procedure
P FR47LATEP       B                   EXPORT
      *
      * -------------------
      * Procedure Interface
      * -------------------
D FR47LATEP       PI             1  0
D  FHOT1                              LIKE(FHOT)
D  FHPRO1                             LIKE(FHPRO)
D  FHPUDT1                            LIKE(FHPUDT)
D  FHDADT1                            LIKE(FHDADT)
D  FHDDAT1                            LIKE(FHDDAT)
D  FHSCD1                             LIKE(FHSCD)
D  FHDT1                              LIKE(FHDT)
D  FHCCD1                             LIKE(FHCCD)
D  FHCCT1                             LIKE(FHCCT)
D  FHCST1                             LIKE(FHCST)
D  FHCZIP1                            LIKE(FHCZIP)
      *
      * Local Fields
D LATE            S              4S 0
D PICKUPDATE      S              8S 0
D APPTDATE        S              8S 0
D ARRIVEDT        S              8S 0
D ARRIVETM        S              6S 0
D ESTDLVYDT       S              8S 0
D $DAYS           S              3  0
D SATSUNHOL       S              8S 0
 *
D WORKDATE1       S               D   DATFMT(*ISO)
D RETURNFLD       S              1  0
      *
      * -----------------------------
      * Shipment Delivery Information
      * -----------------------------
      *
      * Pickup Date
C                   EVAL      PICKUPDATE = FHPUDT1
      *
      * Appointment Date
C                   EVAL      APPTDATE = FHDADT1
      *
      * Get Arival Date/Arrival Time(ARRIVEDT/ARRIVETM)
C                   EXSR      ARV_AT_DT
      *
      * Get Service Days($DAYS)
C                   EXSR      GET_SVCDAYS
      *
      * Check for Saturday/Sunday/Holiday Days between Pickup Date and
      * Estimated Date of Delivery(SATSUNHOL)
C                   EXSR      CHK_SATSUN
      *
      * Estimated Delivery Date
C                   EVAL      WORKDATE1 = %DATE(PICKUPDATE)
C                   EVAL      WORKDATE1 = WORKDATE1 +
C                                         %DAYS($DAYS + SATSUNHOL)
C                   EVAL      ESTDLVYDT = %INT(%CHAR(WORKDATE1:*ISO0))
      *
      * -----------------
      * Shipment - Late -
      * -----------------
C                   IF        APPTDATE   = *ZEROS AND
C                             FHDDAT     > ESTDLVYDT
C                   EVAL      LATE = 1
C                   ENDIF
C                   IF        APPTDATE   <> *ZEROS AND
C                             FHDDAT     > APPTDATE
C                   EVAL      LATE = 1
C                   ENDIF
      *
      ****************************************************
      * ARV_AT_DT - Get Date & Time Shipment Arrived at DT
      ****************************************************
C     ARV_AT_DT     BEGSR
      *
C     PROKEY        KLIST
C                   KFLD                    FHOT1
C                   KFLD                    FHPRO1
      *
      * Search All PRO# Freight Bill Comments for Arrive Date/Time
C     PROKEY        SETLL     FRP003
C                   DOU       NOT %EQUAL(FRP003)
C     PROKEY        READE     FRP003
C                   IF        NOT %EQUAL(FRP003) OR %EOF(FRP003)
C                   LEAVE
C                   ENDIF
      *
C                   IF        FCCOD = 'DT'
C                   EVAL      ARRIVEDT = FCDAT
C                   EVAL      ARRIVETM = FCTIM
C                   ENDIF
      *
C                   ENDDO
      * DOU NOT %EQUAL(FRP003)
      *
C                   ENDSR
      ****************************************************
      *
      ********************************
      * GET_SVCDAYS - Get Service Days
      ********************************
C     GET_SVCDAYS   BEGSR
 *
C                   EVAL      $HOT   = FHOT1
C                   EVAL      $HPRO  = FHPRO1
C*                  EVAL      $PUDT  =
C                   EVAL      $SCD   = FHSCD1
C                   EVAL      $OCITY = *BLANKS
C                   EVAL      $OST   = *BLANKS
C                   EVAL      $OZIP  = *BLANKS
C                   EVAL      $DT    = FHDT1
C                   EVAL      $CCD   = FHCCD1
C                   EVAL      $DCITY = FHCCT1
C                   EVAL      $DST   = FHCST1
C                   EVAL      $DZIP  = FHCZIP1
C                   EVAL      $IO    = 'I'
C                   EVAL      $ASDF  = 'P'
C                   EVAL      $DDCF  = *BLANKS
C*                  EVAL      $PASD  =
C*                  EVAL      $DASD  =
C                   EVAL      $DELIV = *BLANKS
C                   EVAL      $DAYS  = *ZEROS
C*                  EVAL      $AC    =
C                   EVAL      $AD    = *ZEROS
C                   CALLP     GETSVCDAYS($HOT:
C                                        $HPRO:
C                                        $PUDT:
C                                        $SCD:
C                                        $OCITY:
C                                        $OST:
C                                        $OZIP:
C                                        $DT:
C                                        $CCD:
C                                        $DCITY:
C                                        $DST:
C                                        $DZIP:
C                                        $IO:
C                                        $ASDF:
C                                        $DDCF:
C                                        $PASD:
C                                        $DASD:
C                                        $DELIV:
C                                        $DAYS:
C                                        $AC:
C                                        $AD)
 *
C                   ENDSR
      ********************************
      *
      ********************************************************
      * CHK_SATSUN - Check for Saturday or Sunday Days between
      *                Pickup Date and Delivered Date
      ********************************************************
C     CHK_SATSUN    BEGSR
 *
 * -------------------------------------------------------------------
 * Read All Dates Between Pickup Date and Arrive Date for Sat. or Sun.
 * -------------------------------------------------------------------
C                   EVAL      SATSUNHOL = *ZEROS
C     FHPUDT1       SETLL     AAL05006
C                   DOU       %EOF(AAL05006)
C                   READ      AAL05006
 * EOF
C                   IF        %EOF(AAL05006)
C                   LEAVE
C                   ENDIF
 * Date is After Arrive Date
C                   IF        WD8 > FHDDAT1
C                   LEAVE
C                   ENDIF
 * Saturday
C                   IF        WDDAY = 6
C                   EVAL      SATSUNHOL = SATSUNHOL + 1
C                   ENDIF
 * Sunday
C                   IF        WDDAY = 7
C                   EVAL      SATSUNHOL = SATSUNHOL + 1
C                   ENDIF
 * Holiday
C     WDDATE        CHAIN     AAP050
C                   IF        WDEXCP = 'H'
C                   EVAL      SATSUNHOL = SATSUNHOL + 1
C                   ENDIF
 *
C                   ENDDO
 * DOU %EOF(AAL05006)
      *
      * -----------
      * Return LATE
      * -----------
C                   EVAL      RETURNFLD = LATE
C                   EVAL      *INLR = *ON
C                   RETURN    RETURNFLD
 *
C                   ENDSR
      ********************************************************
      *
P FR47LATEP       E




MWalter@xxxxxxxxxxxxxxx@midrange.com on 04/14/2005 04:37:48 PM

Please respond to Midrange Systems Technical Discussion
       <midrange-l@xxxxxxxxxxxx>

Sent by:    midrange-l-bounces@xxxxxxxxxxxx


To:    Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc:

Subject:    Re: SQL - *SRVPGM not found


Is the library in which the service program exists, in this case 'AVRTWRK'
in the library list at run time?

Thanks,

Mark

Mark D. Walter
Senior Programmer/Analyst
CCX, Inc.
mwalter@xxxxxxxxxx
http://www.ccxinc.com



             fkany@averittexpr
             ess.com
             Sent by:                                                   To
             midrange-l-bounce         MIDRANGE-L@xxxxxxxxxxxx
             s@xxxxxxxxxxxx                                             cc

                                                                   Subject
             04/14/2005 04:16          SQL - *SRVPGM not found
             PM


             Please respond to
             Midrange Systems
                 Technical
                Discussion
             <midrange-l@midra
                 nge.com>







Can anyone see why I'm having the problem below?  This worked yesterday.
I'm doing something wrong or out of step that I did correctly yesterday.

I keep getting an error in STRSQL when I try to use a UDF in my SQL
statement:
===================================================================
"FR47LATE in AVRTWRK type *SRVPGM not found."

Here are the steps I've taken:
=========================
1) CRTRPGMOD MODULE(AVRTWRK/FR47LATE) SRCFILE(AVRTWRK/QRPGLESRC)

2) CRTSRVPGM SRVPGM(AVRTWRK/FR47LATE) EXPORT(*ALL)

3)
CREATE FUNCTION AVRTWRK/FR47LATE (DEC (3,0), DEC (7,0), DEC
(8,0),DEC (8,0), DEC (8,0), CHAR (7), DEC (3,0), CHAR (7), CHAR
(20), CHAR (2), CHAR (6))
RETURNS DEC (1,0)
language rpgle
deterministic
no sql
returns null on null input
no exterNal action
allow parallel simple call
external name 'AVRTWRK/FR47LATE(FR47LATE)'

4)
DECLARE GLOBAL TEMPORARY TABLE FR47P457A AS
(SELECT FR47LATE(FHOT, FHPRO, FHPUDT, FHDADT, FHDDAT,
FHSCD, FHDT, FHCCD, FHCCT, FHCST, FHCZIP) AS LATE,
FHOT, FHPRO, FHDT, FHDDAT, FHDTIM, FHDADT, FHPUDT,
FHSCD, FHCCD, FHCCT, FHCZIP
FROM FRL00144
WHERE FHDDAT >= 20040501 AND FHDDAT <= 20040531
AND FHOT = 004 AND FHDT = 003)
WITH DATA

Here is the error I get after I press enter for the DECLARE statement:
=========================================================
FR47LATE in AVRTWRK type *SRVPGM not found.

My library list has AVRTWRK at the top.  WRKOBJ FR47LATE returns the
following:
======================================================================
FR47LATE          *SRVPGM     AVRTWRK           RPGLE
FR47LATE          *MODULE     AVRTWRK           RPGLE             Return 1
if FB is Late


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.