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



----- Original Message -----
From: "BirgittaHauser" <Hauser@xxxxxxxxxxxxxxx>
Sent: Friday, February 15, 2008 10:27 AM
Subject: AW: Encapsulation - Service Programs, Procedures, SQL, LDA, etc.

You could always use host variables locally.

We are at V5R4, all recent PTFs, and I cannot compile due to the 'Host Name Not Unique' error. I have a data structure setup in a global D-spec, and my local procedures use LikeDs() to create a local copy. Both procedures in the example below use the exact same name and declaration.

Am I missing something?

Thanks,
JD

HNOMAIN OPTION(*NODEBUGIO : *SRCSTMT)

D l_QAOKP01A e ds extname(QAOKP01A) qualified
D l_TDNOTES e ds extname(TDNOTES) qualified

Dl_DirEDs ds qualified inz
D DirE like(l_QAOKP01A.WOS1DDEN)
D DirGrp like(l_QAOKP01A.WOS1DDGN)

DGetUsrDirE pr like(l_DirEDs)
D UserID like(l_QAOKP01A.WOS1USRP) const
D options(*nopass)

DTskAddLog pr n
D NteTyp const like(l_TDNOTES.NteTyp)
D NteId const like(l_TDNOTES.NteId)
D NteTxt const like(l_TDNOTES.NteTxt)

//--------------------------------------------------------------------
// PROGRAM NO: GetUsrDirE
//--------------------------------------------------------------------
PGetUsrDirE b export
DGetUsrDirE pi like(l_DirEDs)
D UserID like(l_QAOKP01A.WOS1USRP) const
D options(*nopass)

D DirEDs ds likeds(l_DirEDs) inz
/free
// If User passed, use it
if %parms() = 1;
exec sql
Select
WOS1DDEN, WOS1DDGN
Into
:DirEDs.DirE, :DirEDs.DirGrp
From
QUSRSYS/QAOKP01A
Where
WOS1USRP = :UserID;
else;
exec sql
Select
WOS1DDEN, WOS1DDGN
Into
:DirEDs.DirE, :DirEDs.DirGrp
From
QUSRSYS/QAOKP01A
Where
WOS1USRP = USER;
endif;

// Return result
return DirEDs;

/end-free
PGetUsrDirE e

//--------------------------------------------------------------------
// PROGRAM NO: TskAddLog
//--------------------------------------------------------------------
PTskAddLog b export
DTskAddLog pi n
D NteTyp const like(l_TDNOTES.NteTyp)
D NteId const like(l_TDNOTES.NteId)
D NteTxt const like(l_TDNOTES.NteTxt)

D DirEDs ds likeds(l_DirEDs) inz
/free

// Get User
DirEDs = GetUsrDirE();

// Insert Note record
exec sql
Insert Into
TDNOTES
(NteTyp, NteId, NteDT, NteUsr, NteLin, NteTxt)
Values(
:NteTyp, :NteId, CURRENT TIMESTAMP,
:DirEDs.DirE, 1, :NteTxt);

Return (SQLCOD = *zero);

/end-free
PTskAddLog e




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.