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



>Hi all

>I wonder about how can I control ODBC connections and file usage by this
connections.
>I want to allow only one user for example or only one file i mean how can I
secure my files on AS/400 from ODBC >>
>usage? Anybody can give me information about ODBC connections?

Here is a template from ibm example.
Hope this can help.


0001.00 H
0002.00  ** OS/400 SERVERS - SAMPLE USER EXIT PROGRAM
0003.00  **
0004.00  ** THE FOLLOWING RPG/400 PROGRAM UNCONDITIONALLY
0005.00  ** ACCEPTS ALL REQUESTS. IT CAN BE USED AS A SHELL
0006.00  ** FOR SPECIFIC APPLICATIONS. NOTE: REMOVE THE
0007.00  ** SUBROUTINES AND CASE STATEMENT ENTRIES FOR THE SERVERS
0008.00  ** THAT DO NOT REQUIRE
0009.00  ** SPECIFIC EXIT PROGRAM HANDLING FOR BETTER PERFORMANCE.
0010.00  **
0011.00 D*
0012.00 D* NECESSARY ARRAY DEFINITIONS FOR TRANSFER FUNCTION
0013.00 D* AND REMOTE SQL
0014.00 D*
0015.00 D*
0016.00 D*
0017.00 D PCSDTA          DS
0018.00 D  USERID                 1     10
0019.00 D  APPLID                11     20
0020.00 D*
0021.00 D* SPECIFIC PARAMETERS FOR VIRTUAL PRINTER
0022.00 D*
0023.00 D  VPFUNC                21     30
0024.00 D  VPOBJ                 31     40
0025.00 D  VPLIB                 41     50
0026.00 D  VPIFN                 71     75  0
0027.00 D  VPOUTQ                76     85
0028.00 D  VPQLIB                86     95
0029.00 D*
0030.00  *
0031.00 D* SPECIFIC PARAMETERS FOR MESSAGING FUNCTION
0032.00 D  MFFUNC                21     30
0033.00 D*
0034.00 D* SPECIFIC PARAMETERS FOR TRANSFER FUNCTION
0035.00 D*
0036.00 D  TFFUNC                21     30
0037.00 D  TFOBJ                 31     40
0038.00 D  TFLIB                 41     50
0039.00 D  TFMBR                 51     60
0040.00 D  TFFMT                 61     70
0041.00 D  TFLEN                 71     75  0
0042.00 D  TFREQ                 76   4171
0043.00 D                                     DIM(4096)
0044.00 D*
0045.00 D* SPECIFIC PARAMETERS FOR FILE SERVER
0046.00 D*
0047.00 D* NOTE: FSNAME MAY BE UP TO l6MB.
0048.00 D* FSNLEN WILL CONTAIN THE ACTUAL SIZE OF FSNAME.
0049.00 D*
0050.00 D  FSFID                 21     24B 0
0051.00 D  FSFMT                 25     32
0052.00 D  FSREAD                33     33
0053.00 D  FSWRIT                34     34
0054.00 D  FSRDWR                35     35
0055.00 D  FSDLT                 36     36
0056.00 D  FSNLEN                37     40B 0
0057.00 D  FSNAME                41    296
0058.00 D*
0059.00 D* SPECIFIC PARAMETERS FOR DATA QUEUES
0060.00 D*
0061.00 D  DQFUNC                21     30
0062.00 D  DQQ                   31     40
0063.00 D  DQLIB                 41     50
0064.00 D  DQLEN                 70     75  0
0065.00 D  DQROP                 76     77
0066.00 D  DQKLEN                78     82  0
0067.00 D  DQKEY                 83    338
0068.00 D*
0069.00 D* SPECIFIC PARAMETERS FOR REMOTE SQL
0070.00 D*
0071.00 D  RSFUNC                21     30
0072.00 D  RSOBJ                 31     40
0073.00 D  RSLIB                 41     50
0074.00 D  RSCMT                 51     51
0075.00 D  RSMODE                52     52
0076.00 D  RSCID                 53     53
0077.00 D  RSSTN                 54     71
0078.00 D  RSRSV                 72     75
0079.00 D  RSREQ                 76   4182
0080.00 D                                     DIM(4107)
0081.00 D*
0082.00 D* SPECIFIC PARAMETERS FOR OPTIMIZED NETWORK PRINT SERVER
0083.00 D*
0084.00 D  NPFT                  21     28
0085.00 D  NPFID                 29     32B 0
0086.00  *
0087.00 D* THE FOLLOWING PARAMETERS ADDITIONAL FOR FORMAT SPLF0l00
0088.00 D  NPJOBN                33     42
0089.00 D  NPUSRN                43     52
0090.00 D  NPJOB#                53     58
0091.00 D  NPFILE                59     68
0092.00 D  NPFIL#                69     72B 0
0093.00 D  NPLEN                 73     76B 0
0094.00 D  NPDATA                77    332
0095.00 D*
0096.00 D* Optimized Data Queue server:
0097.00 D*
0098.00 D* QIBM_QZHQ_DATA_QUEUE  format ZHQ00100
0099.00 D*
0100.00 D  DQOFMT                21     28
0101.00 D  DQOFID                29     32B 0
0102.00 D  DQOOBJ                33     42
0103.00 D  DQOLIB                43     52
0104.00 D  DQOROP                53     54
0105.00 D  DQOLEN                55     58B 0
0106.00 D  DQOKEY                59    314
0107.00 D*
0108.00 D* Specific PARAMETERS FOR OPTIMIZED CENTRAL SERVER
0109.00 D*
0110.00 D  CSFMT                 21     28
0111.00 D  CSFID                 29     32B 0
0112.00 D* Optimized Central server:
0113.00 D*
0114.00 D* QIBM_QZSC_LM format ZSCL0l00 for license management calls
0115.00 D*
0116.00 D*
0117.00 D  CSLCNM                33    287
0118.00 D  CSLUSR               288    295
0119.00 D  CSLPID               296    302
0120.00 D  CSLFID               303    306
0121.00 D  CSLRID               307    312
0122.00 D  CSLTYP               313    314B 0
0123.00 D*
0124.00 D* Optimized Central server:
0125.00 D*
0126.00 D* QIBM_QZSC_LM format ZSCS0l00 for system management calls
0127.00 D*
0128.00 D*
0129.00 D  CSSCNM                33    287
0130.00 D  CSSCMY               288    542
0131.00 D  CSSNDE               543    543
0132.00 D  CSSNNM               544    798
0133.00 D*
0134.00  *
0135.00  *
0136.00 D* Optimized Central server:
0137.00 D*
0138.00 D* QIBM_QZSC_LM format ZSCN0l00 for retrive conversion map calls
0139.00 D*
0140.00 D*
0141.00 D  CSNXFM                21     30
0142.00 D  CSNFNC                29     32  0
0143.00 D  CSNFRM                33     36B 0
0144.00 D  CSNTO                 37     40B 0
0145.00 D  CSNCNT                41     42B 0
0146.00 D*
0147.00 D* SPEClFIC PARAMETERS FOR OPTIMIZED DATABASE SERVER
0148.00 D*
0149.00 D  DBFMT                 21     28
0150.00 D  DBFID                 29     32B 0
0151.00 D*
0152.00 D* THE FOLLOWING PARAMETERS ADDITIONAL FOR FORMAT ZDAD0l00
0153.00 D  DBDFIL                33    160
0154.00 D  DBDLIB               161    170
0155.00 D  DBDMBR               171    180
0156.00 D  DBDAUT               181    190
0157.00 D  DBDBFL               191    318
0158.00 D  DBDBLB               319    328
0159.00 D  DBDOFL               329    338
0160.00 D  DBDOLB               339    348
0161.00 D  DBDOMB               349    358
0162.00 D*
0163.00 D* THE FOLLOWING PARRMETERS ADDITIONAL FOR FORMAT ZDAD0200
0164.00 D  DBNUM                 33     36B 0
0165.00 D  DBLIB2                37     46
0166.00 D*
0167.00 D* THE FOLLOWING PARAMETERS ADDITIONAL FOR FORMAT ZDAQ0l00
0168.00 D  DBSTMT                33     50
0169.00 D  DBCRSR                51     68
0170.00 D  DBOPI                 69     70
0171.00 D  DBATTR                71     72
0172.00 D  DBPKG                 73     82
0173.00 D  DBPLIB                83     92
0174.00 D  DBDRDA                93     94B 0
0175.00 D  DBCMT                 95     95
0176.00 D  DBTEXT                96    351
0177.00 D* THE FOLLOWING PARAMETERS REPLACE DBTEXT FOR FORMAT ZDAQ0200
0178.00 D  DBSQCL                96    105
0179.00 D  DBSQLN               133    136B 0
0180.00 D  DBSQTX               137    392
0181.00 D* THE FOLLOWING PARAMETERS ADDITIONAL FOR FORMAT ZDAR0l00
0182.00 D  DBLIBR                33     52
0183.00 D  DBRDBN                53     88
0184.00 D  DBPKGR                89    108
0185.00 D  DBFILR               109    364
0186.00 D  DBMBRR               365    384
0187.00 D  DBFFT                385    404
0188.00  *
0189.00  *
0190.00 D* THE FOLLOWING PARAMETERS ADDITIONAL FOR FORMAT ZDAR0200
0191.00 D  DBRPLB                33     42
0192.00 D  DBRPTB                43    170
0193.00 D  DBRFLB               171    180
0194.00 D  DBRFTB               181    308
0195.00 D*
0196.00 D* Optimized Remote Command/Distributed Program Call server:
0197.00 D*
0198.00 D* QIBM_QZRC_RMT  format CZRC0100
0199.00 D*    RCPGM AND RCLIB ARE NOT USED FOR REMOTE COMMAND CALLS
0200.00 D*
0201.00 D  RCFMT                 21     28
0202.00 D  RCFID                 29     32B 0
0203.00 D  RCPGM                 33     42
0204.00 D  RCLIB                 43     52
0205.00 D  RCNUM                 53     56B 0
0206.00 D  RCDATA                57    312
0207.00 D*
0208.00 D* Optimized Signon server:
0209.00 D*
0210.00 D* QIBM_QZSO_SIGNONSRV format ZSOY0l00 for TCP/IP signon server
0211.00 D*
0212.00 D  SOXFMT                21     28
0213.00 D  SOFID                 29     32B 0
0214.00 D*
0215.00 D***************************************************************
0216.00 D*
0217.00 D #VPRT           C                   CONST('*VPRT     ')
0218.00 D #TRFCL          C                   CONST('*TFRFCL   ')
0219.00 D #FILE           C                   CONST('*FILESRV  ')
0220.00 D #MSGF           C                   CONST('*MSGFCL   ')
0221.00 D #DQSRV          C                   CONST('*DQSRV    ')
0222.00 D #RQSRV          C                   CONST('*RQSRV    ')
0223.00 D #SQL            C                   CONST('*SQL      ')
0224.00 D #NDBSV          C                   CONST('*NDB      ')
0225.00 D #SQLSV          C                   CONST('*SQLSRV   ')
0226.00 D #RTVOB          C                   CONST('*RTVOBJINF')
0227.00 D #DATAQ          C                   CONST('*DATAQSRV ')
0228.00 D #QNPSV          C                   CONST('*QNPSERVR ')
0229.00 D #CNTRL          C                   CONST('*CNTRLSRV ')
0230.00 D #RMTSV          C                   CONST('*RMTSRV   ')
0231.00 D #SIGN           C                   CONST('*SIGNON   ')
0232.00 I*
0233.00 C*
0234.00 C* EXIT PROGRAM CALL PARAMETERS
0235.00 C*
0236.00 C     *ENTRY        PLIST
0237.00 C                   PARM                    RTNCD             1
0238.00 C                   PARM                    PCSDTA
0239.00 C*
0240.00  *
0241.00  *
0242.00 C* INITIALIZE RETURN VALUE TO ACCEPT REQUEST
0243.00 C*
0244.00 C                   MOVE      '1'           RTNCD
0245.00 C*
0246.00 C* COMMON PROCESSING
0247.00 C*
0248.00 C*              COMMON LOGIC GOES HERE
0249.00 C*
0250.00 C* PROCESS BASED ON SERVER ID
0251.00 C*
0252.00 C     APPLID        CASEQ     #VPRT         VPRT
0253.00 C     APPLID        CASEQ     #TRFCL        TFR
0254.00 C     APPLID        CASEQ     #FILE         FILE
0255.00 C     APPLID        CASEQ     #MSGF         MSG
0256.00 C     APPLID        CASEQ     #DQSRV        DATAQ
0257.00 C     APPLID        CASEQ     #RQSRV        RSQL
0258.00 C     APPLID        CASEQ     #SQL          SQLINT
0259.00 C     APPLID        CASEQ     #NDBSV        NDB
0260.00 C     APPLID        CASEQ     #SQLSV        SQLSRV
0261.00 C     APPLID        CASEQ     #RTVOB        RTVOBJ
0262.00 C     APPLID        CASEQ     #DATAQ        ODATAQ
0263.00 C     APPLID        CASEQ     #QNPSV        NETPRT
0264.00 C     APPLID        CASEQ     #CNTRL        CENTRL
0265.00 C     APPLID        CASEQ     #RMTSV        RMTCMD
0266.00 C     APPLID        CASEQ     #SIGN         SIGNON
0267.00 C                   END
0268.00 C                   SETON                                        LR
0269.00 C                   RETURN
0270.00 C*
0271.00 C* SUBROUTINES
0272.00 C*
0273.00 C*
0274.00 C* VIRTUAL PRINT
0275.00 C*
0276.00 C     VPRT          BEGSR
0277.00 C*            SPECIFIC LOGIC GOES HERE
0278.00 C                   ENDSR
0279.00 C*
0280.00 C* TRANSFER FUNCTION
0281.00 C*
0282.00 C* THE FOLLOWING IS AN EXAMPLE OF SPECIFIC PROCESSING
0283.00 C* THAT THE EXIT PROGRAM COULD DO FOR TRANSFER FUNCTION.
0284.00 C*
0285.00  *
0286.00  *
0287.00 C* IN THIS CASE, USERS ARE NOT ALLOWED TO SELECT
0288.00 C* DATA FROM ANY FILES THAT ARE IN LIBRARY QIWS.
0289.00 C*
0290.00 C     TFR           BEGSR
0291.00 C     TFFUNC        IFEQ      'SELECT'
0292.00 C     TFLIB         ANDEQ     'QIWS'
0293.00 C                   MOVE      '0'           RTNCD
0294.00 C                   END
0295.00 C                   ENDSR
0296.00 C*
0297.00 C*
0298.00 C* FILE SERVER
0299.00 C*
0300.00 C     FILE          BEGSR
0301.00 C*             SPECIFIC LOGIC GOES HERE
0302.00 C                   ENDSR
0303.00 C*
0304.00 C* MESSAGING FUNCTION
0305.00 C*
0306.00 C     MSG           BEGSR
0307.00 C*             SPECIFIC LOGIC GOFS HERE
0308.00 C                   ENDSR
0309.00 C* DATA QUEUES
0310.00 C*
0311.00 C     DATAQ         BEGSR
0312.00 C*             SPECIFIC LOGIC GOES HERE
0313.00 C                   ENDSR
0314.00 C*
0315.00 C* REMOTE SQL
0316.00 C*
0317.00 C     RSQL          BEGSR
0318.00 C*             SPECIFIC LOGIC GOES HERE
0319.00 C                   ENDSR
0320.00 C*
0321.00 C* OPTIMIZED SERVERS
0322.00 C*
0323.00 C*
0324.00 C* DATABASE INIT
0325.00 C*
0326.00 C     SQLINT        BEGSR
0327.00 C*             SPECIFIC LOGIC GOES HERE
0328.00 C                   ENDSR
0329.00 C*
0330.00 C* DATABASE NDB (NATIVE DATABASE)
0331.00 C*
0332.00 C     NDB           BEGSR
0333.00 C*             SFECIFIC LOGIC GOES HERE
0334.00 C                   ENDSR
0335.00 C*
0336.00  *
0337.00  *
0338.00 C* DATABASE SQL
0339.00 C*
0340.00 C     SQLSRV        BEGSR
0341.00 C*             SPECIFIC LOGIC GOES HERE
0342.00 C                   ENDSR
0343.00 C*
0344.00 C* DATABASE RETRIVE OBJECT INFORMATION
0345.00 C*
0346.00 C     RTVOBJ        BEGSR
0347.00 C*             SPECIFIC LOGIC GOES HERE
0348.00 C                   ENDSR
0349.00 C*
0350.00 C* DATA QUEUE SERVER
0351.00 C*
0352.00 C     ODATAQ        BEGSR
0353.00 C*             SPECIFIC LOGIC GOES HERE
0354.00 C                   ENDSR
0355.00 C*
0356.00 C* NETWORK PRINT
0357.00 C*
0358.00 C     NETPRT        BEGSR
0359.00 C*             SPECIFIC LOGIC GOES HERE
0360.00 C                   ENDSR
0361.00 C*
0362.00 C* CENTRAL SERVER
0363.00 C*
0364.00 C*
0365.00 C* THE FOLLOWING IS AN EXAMPLE OF SPECIFIC PROCESSING
0366.00 C* THAT THE EXIT PROGRAM COULD DO FOR LICENSE MANAGEMENT.
0367.00 C*
0368.00 C* IN THIS CASE, THE USER "USERALL" WILL NOT BE ALLOWED
0369.00 C* TO EXECUTE ANY FUNCTIONS THAT ARE PROVIDED BY THE
0370.00 C* CENTRAL SERVER FOR WHICH THIS PROGRAM IS A REGISTERED
0371.00 C* EXIT PROGRAM - LICENSE INFORMATION, SYSTEM MANAGEMENT
0372.00 C* OR RETRIVE A CONVERSION MAP.
0373.00 C*
0374.00 C     CENTRL        BEGSR
0375.00 C     USERID        IFEQ      'USERALL'
0376.00 C                   MOVE      '0'           RTNCD
0377.00 C                   ENDIF
0378.00 C*            SPECIFIC LOGIC GOES HERE
0379.00 C                   ENDSR
0380.00 C*
0381.00  *
0382.00  *
0383.00 C* REMOTE COMMAND/DISTRIBUTED PROGRAM CALL
0384.00 C*
0385.00 C* IN THIS CASE, THE USER "USERALL" WILL NOT BE ALLOWED
0386.00 C* TO EXECUTE ANY REMOTE COMMANDS OR REMOTE PROGRAM CALLS
0387.00 C*
0388.00 C     RMTCMD        BEGSR
0389.00 C     USERID        IFEQ      'USERALL'
0390.00 C                   MOVE      '0'           RTNCD
0391.00 C                   ENDIF
0392.00 C                   ENDSR
0393.00 C*
0394.00 C* SIGNON SERVER
0395.00 C*
0396.00 C     SIGNON        BEGSR
0397.00 C*                  SPECIFIC LOGIC GOES HERE
0398.00 C                   ENDSR

You can put this pgm in addexitpgm for database server, tcp signon.


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.