Is there a way to access the Sql server from the z / OS mainframe and get the result of emulating the IBM 3270 terminal?

Is there a way (possibly cheap) to access the Microsoft Sql server from the z / OS mainframe (COBOL program) and get the result in 3270 terminal emulation?
I know that 3270 is a pretty old system, but at CED bank it is still very popular.

+4
source share
8 answers

It depends on what you are actually trying to do. My reading of your question is that you want the mainframe-based process to access the SQL Server database, and then do something with the result, possibly using a 3270 terminal.

If you can use Unix System Services, you can compile a TDS library, such as FreeTDS , and then use the C program to execute you want to get the result. If you want to complicate the work, you can start the connection from your own z / OS environment by compiling the code using IBM C, SAS C or Dignus C / C ++ . I can recommend Dignus, and I used it to create code that interacts with other languages ​​on z / OS. The Dignus headers and the runtime library have (from memory) some FreeBSD lines that help simplify porting.

Using this approach, you can get a boot module that you can call from some other part of your system to do this job, you can link the code to other parts of your system or just send a request and get an exit.

If you want to use Java, you can use something like jTDS and write Java code to do what you need. I did not use Java on z / OS, so I cannot offer specific recommendations there, but I used jTDS on other platforms, and I was pleased with the result.

Update:

You can export the C function as an entry point to the load module, and then call it from Cobol. A C / C ++ implementation must deal with Cobol data structures; they are well defined and predictable, so this is not a problem. Depending on how flexible you need things, you can compile the request into C code and just have a function that executed a predefined request and had an interface to get the result, or you could have something more complex where the request was provided from Cobol programs.

I used this approach to provide API functions for Adabas / Natural developers, and it worked well. The Dignus compiler has a mechanism for callers to provide a runtime library descriptor so that you can control the lifetime of the C runtime from the calling program.

For a C / C ++ developer, this should be fairly simple. If your developers are Cobol developers, things can be a little more complicated.

Access to the gateway is possible, and I am sure that there are gateway products, but I can not recommend it. I saw trashy ones that I would not recommend, but that does not mean that somewhere is not right.

For completeness, I mentioned the possibility of implementing the TDS protocol in Cobol. It sounds like a cruel and ordinary punishment.

+2
source

If you have 3270 terminal emulation, which terminals do you use? PC?

One interesting hack is to use a Cisco router to perform vanilla TCP conversion 3270 on the fly and then write a simple TCP proxy for your SQL Server routines.

+2
source

Not so - 3270 emulators connect to the IBM mainframe. To get data from the mainframe SQL server database, you will need to write a program that runs on the mainframe, which reads the data from the SQL server database. This will require the driver software to run on the mainframe. You may be able to find a third party that does this type of thing, but it will probably be quite expensive.

If you need to compile a report or something that combines data from a mainframe system with external data sources, it may be easier to get data from the mainframe and integrate elsewhere - perhaps some kind of data file.

An alternative would be to extract data from the SQL Server database and upload it to the mainframe as a flat file for processing there.

+1
source

Here is the opportunity if you are writing COBOL programs running in CICS.

First, collapse the SQL Server database stored procedure using a web service wrapper. See sample article 28577 devx.com.

After that, call the new web service hosted on SQL Server by calling the CICS web service.

Use standard CICS BMS commands to present data to the user.

Application Development for CICS Web Services

+1
source

You could do something that I have done in the past. I have written DB2 programs / functions for MS-SQL COBOL that make the MS-SQL SELECT table / view only for DB2. This is due to the creation of a working service on a network server that will only accept TCP / IP connections from the mainframe and use the credentials passed as the user ID / PW used to access the MS-SQL table. Then it issues a selection against the table / view and first passes a list of field names with the total number of rows. Then it will transfer each line, like tab delimited fields, back to the mainframe. COBOL will save the field names in a table that will be used to determine which routine to use to translate each MS-SQL field to DB2. From a DB2 perspective, it looks like a function that returns fields. We have about 30 of them. I had to create an MS-SQL description procedure to help create initial field transaction definitions for the COBOL program. It was also necessary to create a COBOL program for reading descriptive data and creating binding and separation procedures. One COBOL program for each MS-SQL table / view. Here is an example of a function definition. CREATE A FUNCTION
TCL.BALANCING_RECON (VARCHAR (4000))
RETURN
Table (
SCOMPANY CHAR (6),
ANOTHER WARSAW (14),
PUNIT CHAR (3),
LATEFEES DEC (11.2),
FASB_4110 DEC (11.2),
FASB_4111 DEC (11.2),
USERAMOUNT1 DEC (11.2),
USERAMOUNT2 DEC (11.2),
USERFIELD1 VARCHAR (14)
)
LANGUAGE COBOL
CONTINUE AFTER FAILURE

NOT DETERMINISTIC
READS SQL DATA
EXTERNAL NAME DB2TCL02
COLLID DB2TCL02
PARAMETER STYLE SQL
CALL AT NULL INPUT
NO EXTERNAL ACTION
OTHER PARALLEL SCRATCHPAD 8000
ASUTIME LIMIT 100
STOP WOMEN YES
PROGRAM TYPE SUB
WLM ENVIRONMENT DB2TWLM
DB2 SECURITY
DBINFO
; COMMIT;
GRANT EXECUTE ON FUNCTION TCL.BALANCING_RECON TO PUBLIC;

To call a function: SELECT * FROM
TABLE (TCL.BALANCING_RECON (''
)) AS X;

You can put any MS-SQL command between quotation marks.

I have not been asked to update MS-SQL data, so I have not yet overcome this obstacle. DB2 also has a database that tracks the ID / PW and the server on which the running task is running. This happens if the server becomes overloaded, different options can be ported to different servers. The answer is fast, even for large tables. The timeout is the same as the 60 blocking timeout. Transportation is mainly based on IP. DB2 simply treats the data as external table references.

+1
source

How dirty hacks go, have you thought about creating a simple HTTP or TCP server that returns the CSV table data you need?

This means that your client needs a simple HTTP / TCP client to access the data, not the database client library.

0
source

Just get the JDBC driver to access the MS-SQL server. You can then subclass it and use it in your Cobol program and access the database as if you were using it with Java.

Once you get your results, you can submit them through the regular BMS features.

No dirty hacks or fancy network tricks. With IBM Enterprise Cobol, you really can just create a Java class and use it just like you would in a Java space.

0
source

At my company, we use Java to connect to Sql Server.

And CL calls this Java program :)

Very simple...

0
source

Source: https://habr.com/ru/post/1300589/


All Articles