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



Ah, that's good to know....  We just got to V5R3 (from V5R1)...

The nested DS would seem to be the problem....  (currentMessage...)

Thanks,

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-297-2863 or ext. 1863



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of HauserBirgitta
Sent: Wednesday, October 04, 2006 3:35 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Embedded SQL with data structure subfields


Hi,

qualified data structures are supported beginning with release V5R3, but 
nested data structures are not yet (not even under release V5R4) supported.
As far as I remember there were also some problems with data structures 
defined with LIKEDS.

Mit freunlichen Gruessen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les 
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)




----- Original Message ----- 
From: "DeLong, Eric" <EDeLong@xxxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, October 04, 2006 22:13
Subject: RE: Embedded SQL with data structure subfields


What release are you on?  I'm not sure, but I thought the use of qualified 
DS subfields in SQL was still a problem.  This might have been fixed at 
V5R4, but I'm not to that release yet....

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-297-2863 or ext. 1863



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of AGlauser@xxxxxxxxxxxx
Sent: Wednesday, October 04, 2006 11:33 AM
To: RPG programming on the AS400 / iSeries
Subject: Embedded SQL with data structure subfields


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
#####################################################################################
-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.