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

RE: Decrypt XML Elements with Asymmetric Keys

$
0
0

You will have to add the assembly System.Security to the project-->References.

My example should work as is because I have added the ilusing directives to the top which bring in the required namespaces.

     $set ilusing"System.Xml"

     $set ilusing"System.Security.Cryptography"

     $set ilusing"System.Security.Cryptography.Xml"

In Robert's example you would have to add these.

My example uses a declare statement to define the exml data-item and Robert's defines this in local-storage.

Either method should work for you.


RE: Decrypt XML Elements with Asymmetric Keys

$
0
0

Hi Chris,

Thanks for the feedback.

I tested the two examples and both do not instantiate the class.

I had already added the ilusing directives to the top and referenced the nomespaces . Even so, do not instantiate the class. Attached  the source code.

Decrypt XML Elements with Asymmetric Keys

$
0
0

I have this code working in VB.NET and I am migrating to VC2010. NET. Unfortunately I'm having trouble with this function. How would this code?

    Sub Decrypt(ByVal Doc As XmlDocument, ByVal Alg As RSA, ByVal KeyName As String)
        ' Check the arguments.  

        If KeyName Is Nothing Then
            Throw New ArgumentNullException("KeyName")
        End If
        ' Create a new EncryptedXml object.
        Dim exml As New EncryptedXml(Doc)
        ' Add a key-name mapping.
        ' This method can only decrypt documents
        ' that present the specified key name.
        exml.AddKeyNameMapping(KeyName, Alg)
        ' Decrypt the element.
        exml.DecryptDocument()
    End Sub

VC2010 .NET

       method-id Decrypt public.      
       local-storage section.
       01 exml type System.Xml.XmlDocument.       
       procedure division using by value cDoc as type XmlDocument by value cAlg As type RSA by value cKeyName As type String.       
      *    Dim exml As New EncryptedXml(Doc)       - vb.net
          
           set exml to new XmlDocument()
           set exml to cDoc
        
       
      *     exml.AddKeyNameMapping(KeyName, Alg)   - vb.net
              
      *     exml.DecryptDocument()                 - vb.net

           goback.
       end method.

RE: Decrypt XML Elements with Asymmetric Keys

RE: Checking value of alphanumeric and numeric zero

$
0
0

It's not clear what you mean by "works" in your description.  Can you be more specific?

In standard (and Micro Focus) COBOL, moving 0 to an PIC X item results in the character "0" being stored in the data item (there is an implied conversion from numeric to alphanumeric).  Comparing the PIC X item to ZERO or "0" is the same alphanumeric comparison for a PIC X(n) item, it's different in that it's a comparison to a string with n "0" characters in it.  The figurative constant ZERO (ZEROES, ZEROS) is either alphanumeric when associated with an alphanumeric item or numeric when associated with a numeric item.

When you said in-status is defined as pic x, did you mean equivalently pic x(1) or generic pic x(n), where n not equal 1?  If n not = 1, then the result of moving 0 to it would be one "0" character followed by n - 1 spaces.  This would not be equal to ZERO (the figurative constant).  I don't see how GCOS could call its language COBOL if it says a PIC X(n), where n is greater than 1, is equal to ZERO after 0 or "0" is moved to it.  Moving ZERO to PIC X(n) would set all its characters to "0" and then it would compare equal to ZERO as expected.

RE: Checking value of alphanumeric and numeric zero

$
0
0

My second paragraph in my previous response needs a punctuation change to be clearer.  It should have read as follows:

In standard (and Micro Focus) COBOL, moving 0 to an PIC X item results in the character "0" being stored in the data item (there is an implied conversion from numeric to alphanumeric).  Comparing the PIC X item to ZERO or "0" is the same alphanumeric comparison.  For a PIC X(n) item, it's different in that it's a comparison to a string with n "0" characters in it.  The figurative constant ZERO (ZEROES, ZEROS) is either alphanumeric when associated with an alphanumeric item or numeric when associated with a numeric item.

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

The capability of directly accessing both RM and ACU data files from within a managed code application is already in Visual COBOL.

Please see the product documentation here:

Thanks

Checking value of alphanumeric and numeric zero

$
0
0

We are converting some GCOS (Bull) mainframe programs to work on a Microfocus platform. I have a lot of calls for this particular item.


The variable is defined as pic x, and 0 is moved to it, Alphanumeric check. But in the mainframe code (in lots of places) this value is checked against zero (the word, numeric value). In microfocus COBOL this is false, but in GCOS it is true. If I change this:

IF IN-STATUS NOT = ZERO GO TO 580-GET-OUT

to this:

IF IN-STATUS NOT = "0" GO TO 580-GET-OUT

it works in Microfocus (probably for GCOS too, I didn't specifically check). The second statement is true in GCOS.


Is there a setting for the program which will allow "0" to be checked against ZERO or 0?


RE: Checking value of alphanumeric and numeric zero

$
0
0

Thank you for your clarification. I came to find out that this value (IN-STATUS) was in a copybook, and the definition was changed to PIC X(10). As a status value, it should be Pic X(02). When IN-STATUS is set to "00", then the statement IF IN-STATUS = ZERO returns true. It was my ignorance of the value of ZERO, and your pointing out the PIC X(N) idea that led to the solution.

Thanks a lot!

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

Hi Chris,

Since what version is this supported? I am using 2.1 and no error happens but all data is empty.

Regards

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

Latest 2.2 version does not show RM data. Do you have a sample?

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

Access to ACU and RM data files has been supported since 2.1 through the IDXFORMAT directive or FILETYPE directive where 17 correcsponds to ACU and 21 corresponds to RM.

We have also added some features to the extfh.cfg file such as INTEROP and FOLDERS specification.
Please see the documentation here:

If you had an older release of Visual COBOL installed it may have installed a separate add on for Vision file support.
You may have to go to control panel and remove this add on.
Also the environment variables that were required previously on older versions are no longer required and should be removed from your computers environment if you are setting them.

This includes A_CONFIG and CONVERTSTATUS=RM.

A really simple example that will work in managed or native code is the following which uses IDXFORMAT"21" directive instead of using extfh.cfg file.

      program-id. Program1.
     $set idxformat"21"
          select rm-file assign to "testfile.dat"
                         organization is indexed
                         access is dynamic
                         record key is key1
                         file status is file-status.

      data division.
      fd rm-file.
      01 rm-record.
         05 key1  pic 9(3).
         05 rest  pic x(5).
      working-storage section.
      01 file-status pic x(2).
      procedure division.

          open output rm-file
          display "open = " file-status

          perform varying key1 from 1 by 1 until key1 > 10
             move all "X" to rest
             write rm-record
                invalid key
                 display "error = " file-status
             end-write
          end-perform

          close rm-file
          goback.

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

Hi Chris,

It works fine on a Console application (native), but on a Windows Form Managed Cobol no error is shown but data is empty.

Is anyone using RM/COBOL indexed files inside a Windows Form Cobol Managed app in Visual COBOL?

Regards,

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

I have the same problem using a Managed Console Application. Only works with native.

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

Well, I found the solution in ahother thread:

I have found that the 9/198 error when reading a vision file is a result of compiling the application for "Any CPU" on a 64 bit windows machine.  The fix that I have used is to change the "Platform target" on the COBOL configuration page for the project to "x86"


Accessing RM Data files from Managed Visual COBOL

$
0
0

Hi,

I know it is possible to access RM/COBOL indexed files from a Visual COBOL Console app and that this app can be called by a Managed VC app.

But is it possible to use RM/COBOL indexed files directly from Managed code? If not, are you planning to add that support? It is crucial to move apps into Visual COBOL.

Regards

RE: Accessing RM Data files from Managed Visual COBOL

$
0
0

This is not a limitation in the latest product release.

I just tested this using a Winform application set to anyCPU using Visual COBOL 2.2 update 1 and it created and accessed both RM and ACU files correctly.

Thanks.

Adiscf in AIX 7.x

$
0
0

Dear Sir,

We use adiscf.exe in Visual Cobol for Visual Studio and Visual Cobol for Eclipse without problema. When we go to production environment (AIX 7.1) we try to replicate the same with adiscf for Unix and we noted that adiscf is diferent in AIX, por example en Windows PF2, PF8,PF3  in AIX we have PF2, PF8 but we didn´t find the PF3 option.....

 

THANks.....

 

PJM

clustering

$
0
0

Hi,

Currently our application is running on one server and a cold standby. All in Suse linux

Anyone has experience with clustering visual cobol applications?

 

To be more concrete :

I'm looking at multiple servers (at least 3) to be put in a multi-active cluster with shared filesystem (like ocfs or veritas). The cobol applications should then use the same shared filesystem for read+write datafile manipulations.

Some sort of load balancer in front of the applications.

thanks.

Invalid picture strings

$
0
0

I have 2 picture strings that seems to be valid per the documentation (coming from ACUCOBOL), but the compiler is giving errors. Any ideas why these are invalid?

They are:

This one gives error saying "Incompatible qualifiers".

PACT-AMOUNT  PIC S9(9)V99  COMP-3
                 SIGN IS LEADING SEPARATE. 


This one gives error "PICTURE string has illegal precedence or illegal character"

 Disp-Comm-Pct                    PIC ZZZ.Z9.

Thanks

Viewing all 4356 articles
Browse latest View live


Latest Images

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