HELP:How to excute direct call Adabas from PL/I?

I am a newbie in Adabas. I have downloaded adabas 6.1.8 community edition. According to the documentation, adabas can be accessed by the way of direct call from PL/I, but I did not find any useful examples for this case.
Could you kindly help me to figure it out?

  1. the steps to perform Database query commands (S1/S4, S2, S5))
    (command environment?)
  2. the example of direct call access adabas from PL/I

Many Thanks

Hi Kelvin,

Thanks for downloading Adabas. Since it is not quite common to use PL/I
on these platforms we have examples for PL/I and Cobol in the Adabas
version 8.2.1 documentation (Command References).
Please have a look there or download it.

Best regards,
Wolfgang

Hi Wolfgang,

Thanks for your information and quick response!

I found the PLI-ADABAS example according to your direction, but I meet a problem when I try the first example (Example 1).
Could you kindly have a look the following problem?

The souce code has attached to this reply.
The accessAdabas.OBJ has been generated successfully.
When I do the action of linking the .object + .ddl to .exe application,
—ilink accessAdabas.OBJ adalnks.lib adalnk32.lib adalnknc.lib

The complier throw the exception:
—error LNK2029: “?ADABAS”: unresolved external
—There was 1 error detected

Thanks&Best regards,
kelvin
accessAdabas.pli.txt (3.62 KB)

It seems passed the compile after one line is added:
— FETCH ADABAS title(‘adalnk32/adabas’);

but, the program has not any DB data output and ‘ISN_QUANTITY =0’, I doubt the DBID specified in the program is not correct.

Could you kindly tell me how to change DBID in this example 1?
Should I set the CONTROL_BLOCK.FILLER1=‘0xC’ ?/*** DBID = 12 ***/

Thanks&Best regards,
Kelvin

Hi Kelvin,

Yes, you need a database ID. Please see below an example. Unfortunately, not in PL/I but it shows the parameter list.
I hope this helps you.

DCL
1 CONTROL_BLOCK,
02 FILLER1 CHAR (2) INIT (’ ‘),
02 COMMAND_CODE CHAR (2) INIT (’ ‘),
02 COMMAND_ID CHAR (4) INIT (’ '),
02 char (2),
02 FILE_NUMBER BIN FIXED (15) INIT (0),
02 RESPONSE_CODE BIN FIXED (15) INIT (0),

In general, the command reference shows you for each command which fields of the Adabas Control block needs to be filled and where you get information back.

Best regards,
Wolfgang

If you have access to Natural; logon to SYSEXT. Type menu, then scroll down to USR1043. Look at the program to use this USR. It has an excellent description of making a direct call to Adabas.

steve

Hi Wolfgang,

Thanks for your help!

After reference ACB Format documentation, I still have a little confusion on it.(
http://techcommunity.softwareag.com/ecosystem/documentation/adabas/ada618os/commands/calling.htm#acb_format)

For ACB Format, I only find DBID description in the Call Type field rather than you mentioned a new DBID field.

02 COMMAND_ID CHAR (4) INIT (’ '),
02 char (2),
02 FILE_NUMBER BIN FIXED (15) INIT (0),

Besides, I refer to the example of adabasx.h which in the ‘\Adabas\V618\INC’

if CE_HHIGH_ORDER_FIRST

        unsigned char x_cb_db_id;  /*DATABASE number */
        unsigned char x_cb_file_nr; /*FILE number*/

#else
unsigned char x_cb_file_nr; /FILE number/
unsigned char x_cb_db_id; /*DATABASE number */

It seems the DATABASE number should after FILE number.

I have no idea on it. Could you help me to figure it out?

Many thanks&Best regards,
Kelvin

Hi Steve,

Thanks for your information!

I can not logon to SYSEXT, I guess it may cause by the community version of Natural which don not support it.

Thanks&Best regards,
Kelvin

Thanks for your help!

After go through the most of documents and several times attempt, I solve it problem.

Thanks&Best regards,
Kelvin