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




Does anyone have an example of this api working under V5R3, I believe
the examples Ive found have been for previous releases and for v5r3
its been changed.

This program is my quick-and-dirty way of having an "su" command (like you'd have on a Unix system) on the iSeries. I wrote it at V5R3, and haven't tested it on any other release:

     H DFTACTGRP(*NO)

     D SU              PR                  ExtPgm('SU')
     D   password                    32A   const
     D SU              PI
     D   password                    32A   const

     D QsyGetProfileHandle...
     D                 PR                  EXTPROC('QsyGetProfileHandle')
     D   handle                      12A
     D   userid                      10A   const
     D   password                   512A   const options(*varsize)
     D   passwd_len                  10I 0 value
     D   ccsid                       10I 0 value
     D   errcode                  32767A   options(*varsize)

     D QsySetToProfileHandle...
     D                 PR                  EXTPROC('QsySetToProfileHandle')
     D   handle                      12A
     D   errcode                  32767A         options(*varsize)

     D QsyReleaseProfileHandle...
     D                 PR                  EXTPROC('QsyReleaseProfileHandle')
     D   handle                      12A
     D   errcode                  32767A         options(*varsize)

     D ErrorCode       ds
     D    bytesProv                  10I 0 inz(0)
     D    bytesAvail                 10I 0 inz(0)

     D Handle          s             12A

      /free

           QsyGetProfileHandle( Handle
                              : 'QSECOFR'
                              : %trim(password)
                              : %len(%trim(password))
                              : -1
                              : ErrorCode );

           QsySetToProfileHandle(Handle: ErrorCode);
           QsyReleaseProfileHandle(Handle: ErrorCode);

           *inlr = *on;
      /end-free

What I use this for is giving myself QSECOFR's access without having to sign off and back on again. I simply type the following:

     CALL PGM(SU) PARM('redrover')

(replace 'redrover' with the correct password for your QSECOFR account)

Hopefully that'll help you understand what you're doing wrong. Incidentally, the problem with your code is that you're passing the "10I 0" parameters by CONST instead of VALUE -- and that would've been a problem at ANY release of OS/400!

I already replied to this in the iSeriesNetwork.com forums.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.