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

WORKING-STORAGE or DATA-DIVISION sections limits

$
0
0

In the Net Express is limit 256 MB for variable declaration. Is there a limits for WORKING-STORAGE or DATA-DIVISION sections in the Visual Cobol 2.3 update 2? What are the limits for file size in this new cobol? Thanks for an answer. Petr.


RE: WORKING-STORAGE or DATA-DIVISION sections limits

$
0
0

You may find the answer here in the documentation.

Regards,

RE: Signature xml file

$
0
0

Boa tarde Chris Glazier , qual tipo de projeto devo criar para funcionar esse programa, já tentei em vários e não deu certo, desculpe tanto questionamento, e que compramos agora o visual cobol for visual studio.

obrigado

Renato

Automating MF native file conversion to MYSQL

$
0
0

Hi,

Might be reinventing the wheel here (?).... I'm writing a program to generate code to handle MYSQL calls and return data to existing cobol record layouts i.e. so that COBOL doesn't really know the difference when e.g. a 'write myfile-rec' is simply replaced with a 'perform db-myfile-insert'.

I have a question... Some of my records contain binary fields e.g. PIC 9(5)V99 comp. The db equivalent MYSQL field is defined as decimal(7,2). Visual COBOL says I can't use the PIC 9(5)V99 comp. field as a host variable. Is that right or am I doing something wrong? I've worked around it by using an intermediary host field but obv that makes the process more involved and fiddly. 

If anyone's interested, the program I've written (so far, it's a work in progress but basically works) takes in a record layout spec like so:

Table, Field, Type, NonStdField, KeyNo
products, PROD-COMPANY, X, ,1
products, PROD-TYPE, X, ,1
products, PROD-GROUP, X, ,1
products, PROD-CODE, X, ,1
products, PROD-DESC, X, ,
products, PROD-PRICE-TYPE, X, ,
products, PROD-PRICE, 2, Y,
products, PROD-linage-min-price, 2, Y,
products, PROD-box-charge-post, 2, Y,
products, PROD-box-charge-collect, 2, Y,
products, PROD-incl-std-vat-flag, X, ,
vat,vat-start-ccyymmdd, %Y%m%d, ,1desc
vat,vat-rate, 2, ,
 
AND IT CREATES SQL LIKE SO....
 
      db-start section.
           exec sql
               whenever sqlerror perform db-error
           end-exec.
           exit.
 
       db-finish section.
           exit.
 
       db-error section.
           display mfsqlmessagetext, sqlcode.
           exit.
 
      *-----------------------------------------------------------------
       db-products-get-next section.
      *-----------------------------------------------------------------
        if db-products-cursor-closed
         exec sql
          declare db-products-curs cursor for
           select
            prod_company,
            prod_type,
            prod_group,
            prod_code,
            prod_desc,
            prod_price_type,
            prod_price,
            prod_linage_min_price,
            prod_box_charge_post,
            prod_box_charge_collect,
            prod_incl_std_vat_flag
           from products
           order by
            prod_company
            , prod_type
            , prod_group
            , prod_code
         end-exec
         exec sql
          open db-products-curs
         end-exec
         set db-products-cursor-open to true
        end-if.
 
        exec sql
         fetch db-products-curs
          into
           :prod-company,
           :prod-type,
           :prod-group,
           :prod-code,
           :prod-desc,
           :prod-price-type,
           :db-oddNum01,
           :db-oddNum02,
           :db-oddNum03,
           :db-oddNum04,
           :prod-incl-std-vat-flag
        end-exec.
 
        if sqlcode = 100
         exec sql
          close db-products-curs
         end-exec
         set db-products-cursor-closed to true
        else
         move db-oddNum01 to prod-price
         move db-oddNum02 to prod-linage-min-price
         move db-oddNum03 to prod-box-charge-post
         move db-oddNum04 to prod-box-charge-collect
        end-if.
 
      *-----------------------------------------------------------------
       db-products-get-by-key section.
      *-----------------------------------------------------------------
        move prod-price to db-oddNum01.
        move prod-linage-min-price to db-oddNum02.
        move prod-box-charge-post to db-oddNum03.
        move prod-box-charge-collect to db-oddNum04.
        exec sql
         select
          prod_company,
          prod_type,
          prod_group,
          prod_code,
          prod_desc,
          prod_price_type,
          prod_price,
          prod_linage_min_price,
          prod_box_charge_post,
          prod_box_charge_collect,
          prod_incl_std_vat_flag
         into
          :prod-company,
          :prod-type,
          :prod-group,
          :prod-code,
          :prod-desc,
          :prod-price-type,
          :db-oddNum01,
          :db-oddNum02,
          :db-oddNum03,
          :db-oddNum04,
          :prod-incl-std-vat-flag
         from products
         where
          prod_company = :prod-company
          and prod_type = :prod-type
          and prod_group = :prod-group
          and prod_code = :prod-code
        end-exec.
 
        if sqlcode = 100
         set db-products-not-found to true
        else
         set db-products-not-found to true
          move db-oddNum01 to prod-price
          move db-oddNum02 to prod-linage-min-price
          move db-oddNum03 to prod-box-charge-post
          move db-oddNum04 to prod-box-charge-collect
        end-if.
 
      *-----------------------------------------------------------------
       db-products-delete section.
      *-----------------------------------------------------------------
        move prod-price to db-oddNum01.
        move prod-linage-min-price to db-oddNum02.
        move prod-box-charge-post to db-oddNum03.
        move prod-box-charge-collect to db-oddNum04.
        exec sql
         delete from products
         where
          prod_company = :prod-company
          and prod_type = :prod-type
          and prod_group = :prod-group
          and prod_code = :prod-code
        end-exec.
 
      *-----------------------------------------------------------------
       db-products-insert section.
      *-----------------------------------------------------------------
        move prod-price to db-oddNum01.
        move prod-linage-min-price to db-oddNum02.
        move prod-box-charge-post to db-oddNum03.
        move prod-box-charge-collect to db-oddNum04.
        exec sql
         insert into products
         (
          prod_company,
          prod_type,
          prod_group,
          prod_code,
          prod_desc,
          prod_price_type,
          prod_price,
          prod_linage_min_price,
          prod_box_charge_post,
          prod_box_charge_collect,
          prod_incl_std_vat_flag
         ) values (
          :prod-company,
          :prod-type,
          :prod-group,
          :prod-code,
          :prod-desc,
          :prod-price-type,
          :db-oddNum01,
          :db-oddNum02,
          :db-oddNum03,
          :db-oddNum04,
          :prod-incl-std-vat-flag
         )
        end-exec.
 
      *-----------------------------------------------------------------
       db-products-update section.
      *-----------------------------------------------------------------
        move prod-price to db-oddNum01.
        move prod-linage-min-price to db-oddNum02.
        move prod-box-charge-post to db-oddNum03.
        move prod-box-charge-collect to db-oddNum04.
        exec sql
         update products set
          prod_company = :prod-company,
          prod_type = :prod-type,
          prod_group = :prod-group,
          prod_code = :prod-code,
          prod_desc = :prod-desc,
          prod_price_type = :prod-price-type,
          prod_price = :db-oddNum01,
          prod_linage_min_price = :db-oddNum02,
          prod_box_charge_post = :db-oddNum03,
          prod_box_charge_collect = :db-oddNum04,
          prod_incl_std_vat_flag = :prod-incl-std-vat-flag
         where
          prod_company = :prod-company
          and prod_type = :prod-type
          and prod_group = :prod-group
          and prod_code = :prod-code
        end-exec.
 
      *-----------------------------------------------------------------
       db-products-ins-or-upd section.
      *-----------------------------------------------------------------
        perform db-products-insert.
        if sqlcode = -1062
         perform db-products-update
        end-if.
 
      *-----------------------------------------------------------------
       db-vat-get-next section.
      *-----------------------------------------------------------------
        if db-vat-cursor-closed
         exec sql
          declare db-vat-curs cursor for
           select
            vat_start_ccyymmdd,
            vat_rate
           from vat
           order by
            vat_start_ccyymmdd desc
         end-exec
         exec sql
          open db-vat-curs
         end-exec
         set db-vat-cursor-open to true
        end-if.
 
        exec sql
         fetch db-vat-curs
          into
           :db-date01,
           :vat-rate
        end-exec.
 
        if sqlcode = 100
         exec sql
          close db-vat-curs
         end-exec
         set db-vat-cursor-closed to true
        else
         string db-date01(1:4) db-date01(6:2) db-date01(9:2)
          into vat-start-ccyymmdd
        end-if.
 
      *-----------------------------------------------------------------
       db-vat-get-by-key section.
      *-----------------------------------------------------------------
        string vat-start-ccyymmdd(1:4) '-'
               vat-start-ccyymmdd(5:2) '-'
               vat-start-ccyymmdd(7:2) '-'
         into db-date01.
        exec sql
         select
          vat_start_ccyymmdd,
          vat_rate
         into
          :db-date01,
          :vat-rate
         from vat
         where
          vat_start_ccyymmdd = :db-date01
        end-exec.
 
        if sqlcode = 100
         set db-vat-not-found to true
        else
         set db-vat-not-found to true
          string db-date01(1:4) db-date01(6:2) db-date01(9:2)
           into vat-start-ccyymmdd
        end-if.
 
      *-----------------------------------------------------------------
       db-vat-delete section.
      *-----------------------------------------------------------------
        string vat-start-ccyymmdd(1:4) '-'
               vat-start-ccyymmdd(5:2) '-'
               vat-start-ccyymmdd(7:2) '-'
         into db-date01.
        exec sql
         delete from vat
         where
          vat_start_ccyymmdd = :db-date01
        end-exec.
 
      *-----------------------------------------------------------------
       db-vat-insert section.
      *-----------------------------------------------------------------
        string vat-start-ccyymmdd(1:4) '-'
               vat-start-ccyymmdd(5:2) '-'
               vat-start-ccyymmdd(7:2) '-'
         into db-date01.
        exec sql
         insert into vat
         (
          vat_start_ccyymmdd,
          vat_rate
         ) values (
          :db-date01,
          :vat-rate
         )
        end-exec.
 
      *-----------------------------------------------------------------
       db-vat-update section.
      *-----------------------------------------------------------------
        string vat-start-ccyymmdd(1:4) '-'
               vat-start-ccyymmdd(5:2) '-'
               vat-start-ccyymmdd(7:2) '-'
         into db-date01.
        exec sql
         update vat set
          vat_start_ccyymmdd = :db-date01,
          vat_rate = :vat-rate
         where
          vat_start_ccyymmdd = :db-date01
        end-exec.
 
      *-----------------------------------------------------------------
       db-vat-ins-or-upd section.
      *-----------------------------------------------------------------
        perform db-vat-insert.
        if sqlcode = -1062
         perform db-vat-update
        end-if.
 
Linden

 

 

 

RE: Signature xml file

$
0
0

Olá Renato, o projeto em questão é Windows Forms e você precisa referenciar o namespace System.Security. É necessário também que você tenha o certificado digital A3 plugado na máquina.

Hi Renato, the project in question is Windows Forms and you need to create a reference to the System.Security namespace. You must also have the A3 digital certificate plugged in your machine.

https://www.youtube.com/results?search_query=visual+cobol+altair+borges

RE: Signature xml file

$
0
0

Olá Altair, obrigado pela atenção, fiz o que você me passou, mas não deu certo, ainda não sabemos utilizar com o projeto do visual cobol for visual studio, pois compramos a um mês, e ainda estamos apanhando nisso, teria como me passar um passo a passo, agradeceria muito.

Obrigado

Signature xml file

$
0
0

I'm trying to convert a C # code that signer a xml file to vc2010 2.2. NET. I've searched the forum but have not found any examples of signature xml file.
Attached the code in C # and running the code in VC I'm trying to create. Someone from the forum could help me?

VC 2010 2.2 .NET

S.O. XP SP3

RE: Visual Cobol PE License won't activate

$
0
0

I am in the same boat - have been trying to activate for five days now with no success and I have a class coming up very soon. Getting really desperate. I hope this won't get me in trouble for mentioning it, but there is the Raincode compiler that is free and can handle simulated DB/2 and CICS and COBOL2002 if you are as desperate as I am. It plugs itself into Visual Studio 2013 (free version).


RE: Cobol Server Upgrade

$
0
0

Hello Brendan,

The answer is yes, but you will also need to remove the runtime assemblies from COBOL Server 2.3 that were copied to the application folder and replace them with the ones from version 2.1.

Regards,

Cobol Server Upgrade

$
0
0

Hi

We are upgrading from a .NET Windows Forms application in Visual Cobol 2.1running on Windows XP pc's, pointing to Cobol Server 2.1 license on Windows Server 2012 to Visual Cobol 2.3 on new Windows 10 pc's pointing, to Cobol Server 2.3 license on same server.  We want to confirm that these are the steps to be taken to upgrade:

1. Uninstall Cobol Server 2.1 on server.

2. Delete any directories used by Cobol Server not deleted during uninstall.

3. Install Cobol Server 2.3.

4. Copy the run-time assemblies from, say, %ProgramFiles(x86)%\Micro Focus\COBOL Server\redist\v4.0 to the application folder.

No need to revoke the server license before uninstalling Cobol Server 2.1.

On each Windows 10 pc:

Install Micro Focus License Asministration tool and use Advanced configuration to point the pc to the license server.

Also, if we run into difficulties and want to roll back to Cobol Server 2.1 can we just uninstall Cobol Sevrer 2.3 and reinstall Cobol Server 2.1?

Thank you

Brendan

Free Cobol Licence not working

$
0
0

I am a student attempting to activate the free 1 year version of visual cobol.  I have downloaded it but when i try to acquire the free license i get an error.  Please advise

Visual Cobol PE License won't activate.

$
0
0

I am trying to activate the free Visual Cobol PE version after installing it every time I try it throws a Authorization Process Error. "MG0006: unable to authorized the request."

RE: Visual Cobol PE License won't activate.

$
0
0

I just tested this here and the license activation worked OK for me so it appears like this is now fixed.

Can you please give the activation another try?

Thanks.

RE: Visual COBOL PE won't activate

$
0
0

I just tested this here and the license activation worked OK for me so it appears like this is now fixed.

Can you please give the activation another try?

Thanks.

RE: SuppressUnmanagedCodeSecurity

$
0
0

Actually if you compile the managed code application using the directive ILNONATIVE the pass by reference will work correctly.

Thanks.


RE: SuppressUnmanagedCodeSecurity

$
0
0

managed app compiled with $set noilnative

         declare myhandle as binary-long = self::Handle as binary-long
         declare myret as binary-long
         call "subprog" using myhandle myret

native subprog.

      working-storage section.
      01 pp  procedure-pointer.
      linkage section.
      01 winhandle    pic x(4) comp-5.
      01 retlength    pic x(4) comp-5.
      procedure division using winhandle retlength.
          set pp to entry "User32"
          call winapi "GetWindowTextLengthA"
             using by value winhandle
             returning retlength

RE: SuppressUnmanagedCodeSecurity

$
0
0

Chris,

Pardon, but I believe it is spelled like this:  NOILNATIVE

Thanks

dynamically loading a winform based on a string

$
0
0

The issue.

I have a c# application that does the following: reads an xml file with menu tree items, gets the user and groups from AD then using that information builds the menu tree. Each of the menu tree leaves are visual cobol programs that the user can run.

Currently I have a switch statement looking at the name of the node and opening the appropriate winform (visual cobol). I would like to use reflection by having the visual cobol class name in the xml file. That way when I add a new program, I can update the xml file and upload the cobol program without needing to recompile the c sharp application.

I've tried using:

Activator.CreateInstance which gives me a "could not load type ***** from assembly *******"

 Assembly.GetExecutingAssembly().CreateInstance which throws "object reference not set to as instance of an object"

Any one have any thoughts? I have not issue just writing a large switch and recompiling whenever a new program is added.

RE: dynamically loading a winform based on a string

$
0
0

The following works for me when the Winforms app is in the same folder as the calling cs program:

        static void Main(string[] args)
        {
            Assembly MyCOB = Assembly.Load("WindowsFormsApplication1"); // DALL is name of my dll
            Type MyLoadClass = MyCOB.GetType("WindowsFormsApplication1.Form1"); // LoadClass is my class
            System.Windows.Forms.Form obj = (System.Windows.Forms.Form)Activator.CreateInstance(MyLoadClass);
            
            obj.ShowDialog();
        }
    }

RE: SuppressUnmanagedCodeSecurity

$
0
0

Yes, you are correct the NO is before the IL. I spelled it correctly in the second post with the example.

Viewing all 4356 articles
Browse latest View live


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