Hi,

I am sorry, I can't help on the specific topic, maybe John is around and can chime in. But..

I have been working trying to allow SQLite to compile and work unchanged under z/OS USS. I think there is a bug in sqlite3.c which should be fixed. I've posted a message to the list a couple of weeks ago about this topic.

Below a shell script to be run under z/OS USS to prepare the autoconf version of SQLite to compile (it also fixes the above issue).

Save the script as zospatch.sh under USS, mark it executable and follow the contained instructions.

-Script starts here -----------------------------------------------

#
# This script patches the autoconf version of sqlite to compile on z/OS
#
# The complete process is described below:
#
# From your PC
# 1 - Download the autoconf package from www.sqlite.org/download.html
# 2 - gunzip sqlite-autoconf-xyy0000.tar.gz
# 3 - ftp sqlite-autoconf-xyy0000.tar to z/OS USS
#
# Under z/OS USS
# 4 - pax -ofrom=iso8859-1,to=ibm-1047 -rf sqlite-autoconf-xyy0000.tar
# 5 - ./configure --enable-dynamic-extensions
# 6 - sh zospatch.sh (this script)
# 7 - make
#
# sqlite and its shell should compile properly
#

mv sqlite3.c sqlite3.c.original
awk 'BEGIN { aiClass_found = 0; ifdef_SQLITE_EBCDIC_found = 0 }
($0 == "static const unsigned char aiClass[] = {") { aiClass_found = 1 }
((aiClass_found) && ($0 == "#ifdef SQLITE_EBCDIC")) { ifdef_SQLITE_EBCDIC_found = 1 } (substr($0, 1, 8) == "/* 1x */") { if (aiClass_found && ifdef_SQLITE_EBCDIC_found) { $9 = " 7,"; aiClass_found = 0; ifdef_SQLITE_EBCDIC_found = 0 } }
(1) { print $0 }' <sqlite3.c.original >sqlite3.c
echo "sqlite3.c patched, original version saved as sqlite3.c.original"

mv Makefile Makefile.original
awk '($0  ~ /^CC = /) { $0 = "CC = xlc" }
($0  ~ /^CFLAGS = /) { $0 = "CFLAGS = -O2 -q32 -qfloat=ieee -qnolist" }
($0  ~ /^LDFLAGS = /) { $0 = "LDFLAGS = -q32" }
($0  ~ /^DEFS = /) { for (i = 1; i <= NF; i++) \
{ if ($i == "-DHAVE_POSIX_FALLOCATE=1") $i = "-DHAVE_POSIX_FALLOCATE=0 -D_XOPEN_SOURCE=600" } }
(1) { print $0 }' <Makefile.original >Makefile
echo "Makefile patched, original version saved as Makefile.original"

-Script ends here -----------------------------------------------

Please note: The process produces a 32 (31) bit version of sqlite as this makes it more easily consumable by existing 31 bit applications. If you want a true 64bit version you just need to change -q32 to -q64 in Makefile CFLAGS and LDFLAGS.

Any feedback is appreciated.

Hope this helps,

mario


On 1/4/19 3:04 PM, Mariusz Stakowski wrote:
Hello,

I'm trying to make working CBT965 package. The environment is z/OS 2.3 and
COBOL 4.2.  I'm struggling with Binder now. After some effort, I've
compiled and linked SQLITE3A with RC=0, which might be considered a
success.:

z/OS V2 R3 BINDER     08:34:23 FRIDAY JANUARY  4, 2019

BATCH EMULATOR  JOB(STAMA235) STEP(SQLITE3A) PGM= IEWL      PROCEDURE(L
    )
IEW2278I B352 INVOCATION PARAMETERS -
CALL,LET,LIST,RENT,REUS,XREF,AMODE=31,RMODE=ANY,CASE=MIXED,COMPAT=ZOSV2R3
IEW2650I 5102 MODULE ENTRY NOT PROVIDED.  ENTRY DEFAULTS TO SECTION
$PRIV000010.


I didn't manage to provide the entry point to the module, which is quite
disturbing to me.

The LOAD module itself seems to be OK. Here is an excerpt from AMBLIST
utility:

     LISTLOAD  DDN=LOADLIB1,MEMBER=(SQLITE3A)

                                   *****  M O D U L E   S U M M A R Y
*****
     MEMBER NAME:  SQLITE3A
              MAIN ENTRY POINT:    00000000
     LIBRARY:      LOADLIB1
              AMODE OF MAIN ENTRY POINT: 31
         NO ALIASES **

------------------------------------------------------------------------------------------------------------------------

                        ****          ATTRIBUTES OF MODULE           ****

                 **   BIT  STATUS         BIT  STATUS         BIT  STATUS
      BIT  STATUS   **
                       0  RENT             1  REUS             2  NOT-OVLY
        3  NOT-TEST
                       4  NOT-OL           5  BLOCK            6  EXEC
        7  MULTI-RCD
                       8  NOT-DC           9  ZERO-ORG         10 RESERVED
        11 RLD
                       12 EDIT             13 NO-SYMS          14 RESERVED
        15 NOT-REFR
                       16 RESERVED         17 <16M             18 NOT-PL
        19 NO-SSI
                       20 APF              21 PGM OBJ          22 NOT-SIGN
        23 RESERVED
                       24 NOT-ALTP         25 RESERVED         26 NORMODE64
       27 RMODEANY
                       28 RESERVED         29 RESERVED         30 RESERVED
        31 RESERVED
                       32 NON-MIGR         33 NO-PRIME         34 NO-PACK
       35 RESERVED
                       36 RESERVED         37 RESERVED         38 RESERVED
        39 RESERVED
------------------------------------------------------------------------------------------------------------------------

                                     MODULE SSI:        NONE

                                     APFCODE:           00000000

                                     RMODE:             ANY

                                     LONGPARM:          NO

                                     PO FORMAT:         5

                                     OS COMPAT LEVEL:   z/OSV2R1

                                     XPLINK:            NO

                    *****PROGRAM OBJECT PROCESSED BY BINDER


  However, when I try to run COBTEST1, it abends with 0C1 code. :


STAMA231 JOB04229 OUTPUT   CAIPRINT COBTEST1          CA31

--------------------------------------------------------------------------------------------------------------------------
...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+....80...+....90...+....100..+....110..+....120.
* MODULE CALL SEQUENCE *

************************



          LOAD                                      PROGRAM   PROGRAM ENTRY
           COMPILE                   VER/
          MODULE    PROGRAM/PROCEDURE               ADDRESS   LENGTH
ADDRESS      DATE       TIME    LANGUAGE   REL
          --------  ------------------------------  --------  ------
--------  ----------- --------  ---------  -----
                    SYSTEM                          00000000  000000
00000000                        ASSEMBLER
  CALLED  CEE       CEE                             00000000  000000
00000000                        ASSEMBLER
  CALLED  TESTCOB1  TESTCOB1                        3AF00000  0037EA
3AF00000  04 JAN,2019 04.09.41  COB Z/OS   4.2.0
  CALLED  SQLITE3A  UNKWN1                          00000000  000000
00000000                        ASSEMBLER
(ABENDED)

Here is the second thing which disturbs me - both the ADDRESS and LENGTH
of  SQLITE3A  are zero. It looks like SQLITE3A couldn't be found.

Has somebody some idea what I'm doing wrong?  Perhaps it is not related to
SQLite at all, just some error in Binder parameters for example?

I'd appreciate your help.

Regards

Mariusz
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to