Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all 4356 articles
Browse latest View live

ESQL Issues - Visual Cobol 2.3

$
0
0

Hi,


I am trying to execute below code in visual cobol 2.3, its giving 19703 error.

           EXEC SQL
            CONNECT :WS-ORA-UIP-V USING :WS-ORA-SID-V
           END-EXEC.

WS-ORA-UIP-V= uid\pwd and WS-ORA-SID-V= DBNAME.

Directive was set to:

      $set sql(dbman=odbc targetdb=ORACLE)

Any ideas?

Thank you,

Ramesh


RE: Connection Name Not Found - 19702

$
0
0

Hi Chris,

Sorry, I was on vacation and couldn't respond. I checked my programs again, Sub Program, CONNECTDB and Main Program. Sub Program will connect to CONNECTDB (which has DB details). CONNECTDB is giving me error as 19703. Below is the statement where its throwing error. It connect's to Oracle database.

          EXEC SQL

           CONNECT :WS-ORA-UIP-V USING :WS-ORA-SID-V

          END-EXEC.

WS-ORA-UIP-V = UID\PWD and WS-ORA-SID-V=DBNAME

My directives are set to        $set sql(dbman=odbc targetdb=ORACLE)

Thank You,

Ramesh

Connection Name Not Found - 19702

$
0
0

Hi,

I am migrating from Server Express 5.1 to Visual Cobol 2.3. I am getting error as connection name not found.

I am using ESQL and Sub Program is calling Main Program. Connection is getting established in Sub Program but in Main Program its getting lost.

Any Ideas?

Thank You

RE: Connection Name Not Found - 19702

$
0
0

Hi Ramesh,

Your slash separating the UID and PWD is going in the wrong direction.

It should be UID/PWD.

Also, what is DBNAME referring to? This should be the actual name of the DSN that you created using the ODBC Administration Tool.

RE: Quick scan of IDXFORMAT "8" files

$
0
0

Thanks Michael - I think strings will do the trick for me

RE: SQL cursors in Visual COBOL

$
0
0

Hi Linden,

Cursor names are used internally by the OpenESQL precompiler and do not mean anything at run-time. The actual code generated will be for that of a dynamic SQL statement which will return a result set to the program and bind the columns to the appropriate host variables.

Cursors cannot be shared between programs. All statements that refer to a particular open cursor must be within the same compiled program.

If you declare and open CURSOR1 in prog1 and then call prog2 which declares and opens CURSOR1 these are treated as two distinct cursors.

So once you open a cursor you must perform all of your row fetches within that same program.

Thanks.

RE: SQL cursors in Visual COBOL

$
0
0

Thanks Chris. Great! That's what I was hoping.

SQL cursors in Visual COBOL

$
0
0

Hi,

I'm trying to understand about SQL cursors.

Are cursor names used at run-time i.e. passed to ODBC/SQL engine or just used internally at compile time to associate various EXEC SQL statements.

What I'm wondering is... If a COBOL program, 'A' calls two other programs, 'B' and 'C', alternately, to fetch rows from tables T1 and T2, can programs B and C use the same cursor name i.e. such that both programs have the same-named open cursor?

I'm asking because I'm switching a system from MF native files to MySQL and I'd like to use copybooks of standard procedures. 

Thanks, Linden.

   


RE: looping through control

$
0
0

Something like this?

      perform varying ctrl as type Control thru self::Controls
           if ctrl::GetType = type of TextBox
|                set ctrl as type TextBox::ReadOnly to false
           end-if
      end-perform.

looping through control

$
0
0

looking for a way to loop through a Form.ControlCollection in visual cobol. Any solutions?

set netInt to type System.Windows.Forms.Control+ControlCollection::Count.
set gridViewIndex to 0.

perform until gridViewIndex = netInt

if controlList[gridViewIndex]::GetType = type TextBox
set type System.Windows.Forms.Form+ControlCollection.Item[gridViewIndex]::ReadOnly to false
add 1 to gridViewIndex

end-perform.

compiler errors are: 

ControlCollection has no visible static member Count

type TextBox invalid operand

gridViewItem is invalid operand

CheckChanged event

$
0
0

We are using Visual Cobol, but it is unmanaged, and most of our screens are still dialog screens.

I need to know whenever a certain entry field has its value changed. I know there are ways of doing it with code, dialog etc., but is there something like a CheckChanged Event I can use?  Lost focus doesn't really work because there is no guarantee that the user will tab to a field; they may just click an icon etc.

RE: Using Arrow Keys

$
0
0

Some controls do not fire the keydown event for the arrow or tab keys as they use this for navigation within the control itself.

You can change this behavior by using the PreviewKeyDown event to capture these keys and change them to input keys. They can then be caught by the KeyDown event on the form.

Here is a snippet of the two handler methods to use. Use the same PreviewKeyDown handler for each of your controls where you want to be able to trap these keys. You should also set the form property KeyPreview to true.

method-id Form1_KeyDown final private.
       procedure division using by value sender as object e as type System.Windows.Forms.KeyEventArgs.
           evaluate e::KeyCode
              when type Keys::PageUp 
                set textBox1::Text to  "pgup"
              when type Keys::PageDown 
                set textBox1::Text to  "pgdn"
              when type Keys::Up
                set textBox1::Text to "up"
              when type Keys::Tab
                set textBox1::Text to  "Tab"
              when type Keys::Down
                set textBox1::Text to  "down"
              when type Keys::Left
                set textBox1::Text to  "left"
              when type Keys::Right
                set textBox1::Text to  "right"
            end-evaluate.
           
       end method.

       method-id Form1_PreviewKeyDown final private.
       procedure division using by value sender as object e as type System.Windows.Forms.PreviewKeyDownEventArgs.

           evaluate e::KeyCode
              when type Keys::PageUp 
              when type Keys::PageDown 
              when type Keys::Up
              when type Keys::Tab
              when type Keys::Down
              when type Keys::Left
              when type Keys::Right
                 set e::IsInputKey to true
            end-evaluate.
          
       end method.

RE: Installation Issues

$
0
0

And to be clear, the MicroFocus CES Daemon and the Micro Focuse Directory Server windows services are running.

RE: Installation Issues

$
0
0

After installing Visual COBOL if you start Visual Studio and try to open or create a COBOL project it should automatically prompt you to install a license.

Alternatively, from the Start Menu navigate to All Programs-->Micro Focus License Manager and then run the License Administration tool. This is where you enter your licenses.

The docs can be found here:

Installation Issues

$
0
0

I'm attempting to install Visual Cobol vcvs2012_231 on Win2012R2 server.

It doesn't ask for any licecnse keys. The installation completed OK. Rebooted server.

How or where do I check how the license for VC is actually entered? I can't find any documentation on that. The online documentation says to use the sh and mflmman commands, but those don't exist in Windows. (Yes I know they are Unix/AIX commands but the online WINDOWS documentation for VC says to use the commands.)

Can anyone provide some insight where and how the licenses are entered and administered? It doesnt appear in the Entereprise Server Administration tool. Or maybe I'm missing something?

Thank you for helping.


EXEC SQL INCLUDE

$
0
0

Hi,

I'd like to understand the use of  EXEC SQL INCLUDE a bit better.

Can somebody explain (or point me to a good doc explanation)... what does EXEC SQL INCLUDE actually do and also what happens if host variables i.e. table layouts etc aren't declared inside one i.e. are just declared as regular working-storage items? Also does it matter if fields 'included' as it were, are not actually used with sql?

Do I actually need these special includes? Are they created automatically?...

a. exec sql include sqlda end-exec.

b. exec sql include sqlca end-exec.

If I do, presumably I could just copy the content of (a) and (b) above into my own copybook? - ideally I'd have a single copybook with all db related fields so that I can just put it into the 100 or so programs I'm converting?

Should mfsqlmessagetext be 'included' ? Does it matter if it is or isn't?  

Thanks in advance,

Linden 

RE: EXEC SQL INCLUDE

$
0
0

Hi Linden,

EXEC SQL INCLUDE is actually the equivalent of a COPY statement. It will make available to the precompiler any source code within the copy file specified in the copybook.

For OpenESQL there is no restriction that host variables need to be within EXEC SQL INCLUDE statements or even within the EXEC SQL BEGIN DECLARE SECTION. You can define SQL host variables using standard COBOL PIC types or you can use SQL TYPEs.

Some preprocessors like Oracle's Pro*COBOL do require that you define host variables within a EXEC SQL BEGIN SECTION and END SECTION headers.

sqlca and sqlda are copybooks that reside in the Visual COBOL\cpylib folder. sqlca is the standard Communication Area and should be brought into every program that uses SQL as this is where error handling variables such as SQLCODE and SQLERRMC are defined. SQLDA is required if you are referencing fields within for using dynamic SQL

mfsqlmessagetext is a Micro Focus extension. If this field is defined then it will be used to store the full message text returned from the execution of a SQL statement. If this is not defined then the message text is only available within the sqlerrmc field and may be truncated because its max length is only 70 bytes and message may be longer.

05  SQLERRM.

     49  SQLERRML    PIC S9(4) COMP-5.

     49  SQLERRMC    PIC X(70).

You can find additional information on SQLCA here:

I would recommend that you do not copy the content of the SQLCA and SQLDA directly into a different copybook. If you wish to have any only one copybook to include then create a copybook that contains the EXEC SQL INCLUDE SQLCA END-EXEC statement itself. That way if the contents of SQLCA ever changes you will get the correct version.

Visual COBOL PE won't activate

$
0
0

Could you help me? I'm a student taking COBOL and I downloaded the Microfocus Visual COBOL PE and installed it in Visual Studio 15 Professional. When I create a COBOL project I get a product activation menu that asks if I want to activate automatically or manually. I tried activating automatically and got a "MG0006: Unable to authorize the request." error. So I tried activating manually and sent an email containing some kind of encrypted string to the license request email address at Microfocus. A Few minutes later I got back an email saying, "Authorization Process Error. The following error occurred during the authorization process: MG0006: Unable to authorize the request. I tried rebooting, reinstalling both Visual Studio and Visual COBOL, and searched the knowledgebase for a solution. This is my dad's computer (he owns Visual Studio 2015) and I don't know what to do. Here's the encrypted string I sent in the email. 

Lucius Michael Dark

RE: RM/Panels

$
0
0

I noticed that a converter from RM/Panels to Visual Cobol is now available, both on Windows and Linux.

RM/Panels

$
0
0

Hi,

Any plans to support RM/Panels in Visual Cobol?

Regards

Viewing all 4356 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>