×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




If you write your own commands, do NOT name them the same as an IBM command.
TGTRLS(*PRV) support does not honour the library qualifier when compiling,
so it will always find the IBM command.  I have a RUNSQLSTM command that
takes an SQL statement and runs it via QMQRY, essentially giving me a
command-line SQL.  Because IBM came out with their own RUNSQLSTM, all of my
local references are qualified in my CL program, thus: BUCK/RUNSQLSTM
SQLSTM('select * from actphy01')

When I compile this to TGTRLS(*PRV), the compiler finds the IBM RUNSQLSTM in
the QSYSVxRyMz library.  The IBM version does not take a SQLSTM parameter
and so the compile dies with CPD0043 30  Keyword SQLSTM not valid for this
command.

>From the V5R1 CL Programming manual:

"When the CL compiler compiles for a supported
 previous release, it first checks for commands
 and files in the previous-release libraries.
 When failing to find the command or file in
 the previous-release libraries, the system
 performs a search of the library list (*LIBL)
 or the qualified library."

Supported by APAR SA61079
http://www-912.ibm.com/supporthome.nsf/a80bff372a96bdfa8625672700593d01/7123
83e05c7379868625673c00831437?OpenDocument


The workaround is to create a user version of the previous libraries:
crtlib qusrv4r4m0
crtlib qusrv4r5m0

and create duplicates of your command there:
CRTDUPOBJ OBJ(RUNSQLSTM) FROMLIB(BUCK) OBJTYPE(*CMD) TOLIB(QUSRV4R4M0)
CRTDUPOBJ OBJ(RUNSQLSTM) FROMLIB(BUCK) OBJTYPE(*CMD) TOLIB(QUSRV4R5M0)

The compiler will search through the QUSRVxRyMz library before the
QSYSVxRyMz library.  The idea behind this QUSRVxRyMz library is that you can
accommodate earlier syntaxes for your own commands, so I understand why it
exists.  I even understand why *PRV disregards my library qualifier (how can
*PRV know about previous releases of my commands otherwise?)


But I have a situation that defies reason: Hosting multiple companies.
Several different companies have their OWN version of RUNSQLSTM; in their
library and specially customised to their needs.  I see no way to tell *PRV
that I want to use COMPANY01/RUNSQLSTM vs. COMPANY02/RUNSQLSTM.  I can only
put a single custom RUNSQLSTM in QUSRVxRyMz.  Grrr.  Time to rename them I
guess.

  --buck


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