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



Hi all,

Only my second try with embedded SQL, and again I'm having trouble!

From the great reference Birgitta mentioned in an earlier thread (Chapter 
7):
Modernizing IBM eServer iSeries Application Data Access - A Roadmap 
Cornerstone
http://www.redbooks.ibm.com/abstracts/sg246393.html?Open

as well as a ITJungle article, I believe this is possible, as I am at 
V5R3, which is supposed to allow data structure subfields as host 
variables.  The externally defined DSes worked wonderfully until I changed 
to SQLRPGLE, but now I get this funny 'PUT129' problem, when clearly the 
name is DSP129.

The strange thing about this code is that the WDSC verifier tells me all 
is well, but when I compile (using CRTSQLRPGI), I get these errors:
SQL1001 External file definition for PUT129A not found.
SQL0312 Position 32 Variable DUMMY1 not defined or not usable.
SQL0312 Position 30 Variable MESSAGE not defined or not usable.
SQL0312 Position 38 Variable ASSET not defined or not usable.
SQL0104 Position 43 Token . was not valid. Valid tokens: FOR WITH FETCH 
ORDER UNION EXCEPT OPTIMIZE.
SQL1001 External file definition for PUT129 not found.


Here is the relevant code:

      // Reefer position history file
     FDSP129    IF A E             DISK

      // log of messages sent
     FDSP129A   UF A E           K DISK

              // DS mimics some XML structure
     D currentMessage...
     D                 DS                  qualified
     D   asset...
     D                                     likeDS(assetType)
     D   reeferStatus...
     D                                     likeDS(reeferStatusType)

      // output DS for writing to file
     D historyFile...
     D               E DS                  extname(DSP129:RTREC:*OUTPUT)
     D                                     qualified

     D assetType...
     D                 DS                  qualified
     D                                     based(TEMPLATE_ONLY)
     D   name...
     D                               15A
     D   status...
     D                                1P 0

     D reeferStatusType...
     D                 DS                  qualified
     D                                     based(TEMPLATE_ONLY)
     D   dateTime...
     D                                 Z
     D   setpointTemp...
     D                                     like(tempInFahrenheitType)
     D   returnTemp...
     D                                     like(tempInFahrenheitType)
     D   dischargeTemp...
     D                                     like(tempInFahrenheitType)
     D   ambientTemp...
     D                                     like(tempInFahrenheitType)
     D   serviceState...
     D                                1P 0
     D   gps...
     D                                     likeDS(gpsType)

     D tempInFahrenheitType...
     D                 S              5P 2 based(TEMPLATE_ONLY)

     D gpsType...
     D                 DS                  qualified
     D                                     based(TEMPLATE_ONLY)
     D   latitude...
     D                                7P 4
     D   longitude...
     D                                9P 4



     P*--------------------------------------------------
     P* Procedure name: isDuplicate
     P* Purpose:        Determine if this message has been processed 
previously
     P* Returns:        *ON if the message is a duplicate, *OFF otherwise
     P* Parameter:      message => The message data
     P*--------------------------------------------------
     P isDuplicate     B
     D isDuplicate     PI              N
     D  message                            LIKEDS(currentMessage)
     D                                     CONST


     D* Local fields
     D RECORD_NOT_FOUND...
     D                 C                   '02000'
     D dummy1...
     D                 S                   like(currentMessage.asset.name)


     C/EXEC SQL
     C+ SELECT rtTrakID  INTO :dummy1
     C+ FROM   DSP129
     C+ WHERE    rtTrakID = :message.asset.name
     C+      AND rtMsgTS  = :message.reeferStatus.dateTime
     C+
     C/END-EXEC

      /FREE
       return (NOT (SQLSTATE = RECORD_NOT_FOUND));

      /END-FREE
     P isDuplicate     E


I'm sure I must be missing something really simple, but I've run out of 
ideas on how to find out what it is.


#####################################################################################
Attention:
The above message and/or attachment(s) is private and confidential and is 
intended 
only for the people for which it is addressed. If you are not named in the 
address 
fields, ignore the contents and delete all the material. Thank you. Have a nice 
day.

For more information on email virus scanning, security and content
management, please contact administrator@xxxxxxxxxxxx
#####################################################################################

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.