Prelinking and link-editing non-XPLINK applications

Before you can link-edit a non-XPLINK application, you must prelink your application with a Db2 ODBC definition sidedeck.

About this task

For non-XPLINK applications, you should use the non-XPLINK ODBC driver. Although doing so is not recommended, you can link-edit your non-XPLINK application as an XPLINK application.

Procedure

To prelink and link-edit non XPLINK applications:

Perform one of the following actions:
  • To link-edit a non-XPLINK ODBC application in z/OS®: Include the DSNAOCLI member as input to the prelinker by specifying it in the prelink SYSIN data definition statement concatenation.

    For an example of z/OS prelink and link-edit jobs, use the DSNTEJ8 and DSNTEJ8X sample jobs in DSN1110.SDSNSAMP.

  • To link-edit a non-XPLINK ODBC application in z/OS UNIX System Services: Use the c89 command to prelink and link-edit C applications and the cxx command to prelink and link-edit C++ applications. Include the following items in the command:
    • The Db2 ODBC non-XPLINK definition sidedeck, DSN1110.SDSNMACS(DSNOCLI), as one of the input data sets.

      Before you can use a Db2 ODBC definition sidedeck for input to the c89 or cxx command, you must either specify an alias that uses .EXP for the last qualifier, or change the value of the _XSUFFIX_HOST z/OS UNIX environment variable.

    • The 'dll' link-edit option.
    Example: Assume that you have already compiled an application named myapp.c to create a myapp.o file in the current working directory and that you specified an alias that uses .EXP as the last qualifier for the Db2 ODBC non-XPLINK definition sidedeck. You use the following c89 command to prelink and link-edit a C application:
    c89  -W l,p,map,noer -W l,dll,AMODE=31,map \
     -o dsn8o3vp dsn8o3vp.o "//'DSN1110.SDSNC.EXP(DSNAOCLI)'"
    You use the following cxx command to prelink and link-edit a C++ application:
    cxx  -W l,p,map,noer -W l,dll,AMODE=31,map \
     -o dsn8o3vp dsn8o3vp.o "//'DSN1110.SDSNC.EXP(DSNAOCLI)'"
    Example: Assume that you have already compiled an application named myapp.c to create a myapp.o file in the current working directory and that you changed the value of the _C89_XSUFFIX_HOST or _CXX_XSUFFIX_HOST environment variable to SDSNMACS. You use the following c89 command to prelink and link-edit a C application:
    c89 -W l,p,map,noer -W l,dll,AMODE=31,map -o dsn8o3vp dsn8o3vp.o
    "//'DSN1110.SDSNMACS(DSNAOCLI)'"
    You use the following cxx command to prelink and link-edit a C++ application:
    cxx -W l,p,map,noer -W l,dll,AMODE=31,map -o dsn8o3vp dsn8o3vp.o
    "//'DSN1110.SDSNMACS(DSNAOCLI)'"