Skip to main content

[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

I am looking into the first two issues as both the assign to environment variable name and the status "05" on open input work as expected when the CALLFH("ACUFH") is not being used.

When CALLFH("ACUFH") is being used, I get the same results that you are getting.

For the last issue, this syntax is not supported in Visual COBOL.
To get the same functionality you would need to do something like the following:

MOVE LOW-VALUES TO KEY-1-WIN
START FICHWIN KEY >= KEY-1-WIN
READ FICHWIN NEXT RECORD

MOVE HIGH-VALUES TO KEY-1-WIN
START FICHWIN KEY
READ FICHWIN PREVIOUS RECORD

[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

The first two issues that you report are incompatibilities that are being addressed in the Visual COBOL R5 product.
I would like to create a support incident for these so that we may better track their progress.

Could you please send to me an e-mail that gives me your serial number, name and company name so that I may correctly attach the RPI information to your customer account?

Send to chris.glazier@microfocus.com

Thank you.

[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

Thank you Chris, Now I sent the mail...

I have another doubt ..

I have configured a program to work with the RM/COBOL File Handler, and it can open correctly a RM/COBOL file.
In the next link, I have seen that the RM/COBOL file status codes are either ANSI'74 file status codes or can be mapped onto extended file status codes...

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.visualcobol.r4u2eclipseux/BKCGCGRMSCS003.html

How is it possible that in my program, if I open a nonexistent file, I receive a file status 35 if this belongs to ANSI85​​???


Thank you


[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

Thank you Chris, Now I sent the mail...

I have another doubt ..

I have configured a program to work with the RM/COBOL File Handler, and it can open correctly a RM/COBOL file.
In the next link, I have seen that the RM/COBOL file status codes are either ANSI'74 file status codes or can be mapped onto extended file status codes...

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.visualcobol.r4u2eclipseux/BKCGCGRMSCS003.html

How is it possible that in my program, if I open a nonexistent file, I receive a file status 35 if this belongs to ANSI85​​???


Thank you


[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

Hello,

Do you know anything about the previous question related with the file status codes?

Thank you

[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

It seems that the documentation is incorrect in that if you are using the RM file handler with CALLFH"ACUFH" then it does not apply.

If you are using the RM file handler then you should receive the same ANSI85 status codes that are returned from RM COBOL programs.


[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

Hello, I am collaborating with mikmng, performing deeper tests on these issues. I've also found that a composite key in the SELECT cannot be referenced in PROCEDURE DIVISION. This is an example:

                 ALTERNATE RECORD IS KEY-6-WIN =

                                     SELECCIONADO-WIN

                                     KEY-1-WIN WITH DUPLICATES

and the error reported:

 8894         MOVE LOW-VALUES TO KEY-6-WIN                                    

*  29-S************************************                            (   0)**

**    Not a data name                                                          

Is there any suggestion to deal with this?

Thanks in advance


[Migrated content. Thread originally posted on 20 December 2011]

Hello,

I am migrating to VisualCobol some RMCOBOL programs , and I have found some problems. I wanted to know if there is some kind of solution for these problems, or if it will be corrected in future VisualCobol versions

1)When we want to verify that a file exists, some programs perform the following instructions ..
             
        ....

           SELECT OPTIONAL FICHSEC ASSIGN TO RANDOM LOC-FICHSEC
                  ORGANIZATION LINE SEQUENTIAL
                  ACCESS IS SEQUENTIAL
                  FILE STATUS IS STAT-FICHSEC.

        ....

           OPEN INPUT FICHSEC.         
           IF   STAT-FICHSEC IS EQUAL '05'
           THEN MOVE "THE FILE NOT EXISTS" TO MENSA
                PERFORM AVISO
                GO FIN-PROGRAMA
           ELSE ...               
           END-IF.
        ....



In the VisualCobol program source, I use the directive NOOPTIONAL-FILE; so when I open the file for I-O, this status-file control works correctly, but not when I open it for INPUT.
What can I do without having to modify the code??


2)When we define the files locations we use environment variables


                ....
                MOVE "$VOL/FILES/FICHSEC1".
                OPEN INPUT FICHSEC.         
                ...


But it doesn't work with VisualCobol. What can we do with it?


3)When we work with Indexed Files, some times we use the sentences:


          START FICHWIN KEY FIRST KEY-1-WIN...
         
          or
         
          START FICHWIN KEY LAST KEY-1-WIN...

But it doesn't work with VisualCobol. Will be worked out in the next versions of VisualCobol???


Thanks in advance

The rules for indexed files in the file-control entry clearly state that the composite key name itself can only be referenced directly in the START or READ statements.

If you wish to initialize this key you must move low-values to the various data items that make up the key:

     MOVE LOW-VALUES TO SELECCIONADO-WIN, KEY-1-WIN

Syntax Rules for Format 4 (Indexed Files)

  1. Split-key-name is a concatenation of one or more data items within a record associated with that file-name. It can be referenced only in START and READ statements.