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




On 01/04/2008, at 7:04 AM, Charles St-Laurent wrote:

I try to convert a RPG/36 to ILE. This program uses a SPECIAL file with
SUBR01 as the subroutine name to get the data from an OCL. The SPECIAL file
is declarer as an primary input file. So I read in the IBM books that I must
pass 5 parameters to SUBR01 (in QSSP library) to obtain the same result with
my converted ILE program. Can someone give me an example of a program that
passes these parameters to SUBR01? I didn't find any example...

Given that no one has responded yet I'll tell you what I think. First caveat is that I (thankfully) skipped S/34 and S/36 and started with S/38 so have no practical knowledge of these Assembler Subroutines. However ...

My understanding is that all the various SUBRnn functions only work in the S/36 Environment. If you are moving to RPG IV (ILE) you must also no longer be using the S/36 Environment therefore this SUBR will not function. You'll need to find a native way of accomplishing what you want.

SUBR01 is invoked via RPG SPECIAL file support. In RPG II this caused 6 (maybe 4--documentation is somewhat unclear) parameters to be passed to the SUBR:

OP CHAR(1) O=Open, C=Close, F=Force, R=Read, W=Write, D=Delete, U=Update last record read
STATUS CHAR(1) 0=OK, 1=Input is at EOF and no data returned, or Output error, 2=Error
ERROR ZND(5,0) Error code: like INFDS
AREA CHAR(*) Area equal to record buffer
ARRAY User specified Array or Table (Primary file only)
LAST Description of (4?) preceding parameters
CHAR(1) C=Char, Z=Zoned
ZND(4,0) Length of parameter in bytes
ZND(2,0) Number of decimal digits (if numeric)
ZND(4,0) Number of elements (if array)

In ILE RPG SPECIAL file support accepts 4 system-supplied parameters plus an optional number of user-defined ones. This support is described in the RPG IV Reference.

You could try either defining a PLIST (or prototype) that matches the SUBR01 definition above, or try defining SUBR01 as the SPECIAL file handler as you would in RPG II. I suspect that both of these will fail due to no longer running in the S/36 Environment.

I presume you are trying to read data embedded in an OCL procedure? What was that ?DATA or something?

You can do similar in CL using the //DATA statement if you process it as a job stream rather than a CL program.

CL job stream--QINLINE1:

//BCHJOB JOB(DUMMY)
CALL QINLINE2
//DATA
The first line
The second line
//
//ENDBCHJOB


RPG IV program--QINLINE2:

FQINLINE IP F 80 DISK
IQINLINE NS
I 1 80 DATA
C MOVE DATA SHOW 50

Although WHY you'd want to do things this way from ILE is beyond me.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.