Skip to main content

I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Which product and version number are you using?

I just tested this here using Net Express 5.1 under Windows 7 and it works perfectly as long as the XML file is closed before the cbl_delete_file is called.

If the file is not closed then the copy works but the delete brings back a return-code of14657 which translates to a file status of 9/65 which is a file locked condition, which is what I would expect.

What is the actual value of return-code after the cbl_delete_file call?

Thanks.


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Chris.

I use Net Express 5.1 version 5.106.0079

The RETURNCODE = 094254592 after the CBL_DELETE_FILE


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

There is a General Problem...

Is the File that you will delete on c:\\

And is the Operating System Windows 7 !?

Then you have the Problem with Windows 7!

Not with your own program!


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

There is a General Problem...

Is the File that you will delete on c:\\

And is the Operating System Windows 7 !?

Then you have the Problem with Windows 7!

Not with your own program!


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Bernd.

I use Window 7 but not on the C:\\ . It is a Network drive.

When I do the same with a no-xml-file the delete is working.

The procedure is:  open , read, close, copy and delete.

When I  open the XML-file and immediately close and then delete,  the error returns


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Bernd.

I use Window 7 but not on the C:\\ . It is a Network drive.

When I do the same with a no-xml-file the delete is working.

The procedure is:  open , read, close, copy and delete.

When I  open the XML-file and immediately close and then delete,  the error returns


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Bernd.

I use Window 7 but not on the C:\\ . It is a Network drive.

When I do the same with a no-xml-file the delete is working.

The procedure is:  open , read, close, copy and delete.

When I  open the XML-file and immediately close and then delete,  the error returns


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

For a test can you please try the following:

1. Use a local drive location like C:\\TEMP instead of a network drive

2. Omit the copy step and see if you get the same error on the delete after just opening and closing the xml file.


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I have test  it, but I get the same RETURNCODE = 094254592 .


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Can you please compile and run the following:

 

      $set preprocess(prexml) endp
       id division.
       program-id.   writexml.
       environment division.
       input-output section.
       file-control.
           select customers assign to "customers.xml"
                            organization is xml
                            document-type is omitted
                            file status is xml-status.

       data division.
       file section.
       xd customers.
       01 customerdb identified by "customerdb"
          count in customerdb-count.
          05 customer-record identified by "customer-record"
             count in customer-record-count.
             10 customer-id pic X(5) identified by "customer-id"
                count in customer-id-count.
             10 customer-name pic X(20) identified by "customer-name"
                count in customer-name-count.
       working-storage section.
       01 xml-status   pic s9(9) value 0.
       01 old-name     pic x(256)  value "customers.xml".
       01 new-name     pic x(256) value "newcust.xml".
       procedure division.

           open output customers
           display xml-status
           move "12345" to customer-id
           move "chris glazier" to customer-name
           write customerdb
           display xml-status
           close customers
           call "CBL_COPY_FILE" using old-name new-name
           display return-code
           call "CBL_DELETE_FILE" using old-name
           display return-code
           stop run.

I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Please can you test "D:\\" or "E:\\"....

Higher then "C:\\"

There was a bug under Windows 7 with the drive "c:\\" and the rights!


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

Please can you test "D:\\" or "E:\\"....

Higher then "C:\\"

There was a bug under Windows 7 with the drive "c:\\" and the rights!


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

One more bug!?

After the last Windows Update i have nearly the same Problem (today) with Net Express 4.0 under Windows 7 64 Bit!

I can open the XML File, read and Close...

So far so good...

But after I Close the File the File is locking too because i have a STOP RUN !?

You can test it self:

Open Net Express 4.4 / 5.0 / 5.1

Open a Project with an XML File (open/read/close etc)

Let the Code run (Animate...)

After the Stop RUN........

--> Change any Line in your Cobol Code and make a rebuild

--> There you become an error!

--> The EXE File that you have use the last time ist NOT finish!?

Then i Close Net Express

And open Net Express with the same Project...

Make a rebuild an the changes form the last time is now complete...

I let the Animator running and it works....

Then again..

Change an Line and the EXE File was locked and the game start an "After the Stop RUN..."

ONE QUESTION:

Wich Firewall did you use?

Norton?


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

One more bug!?

After the last Windows Update i have nearly the same Problem (today) with Net Express 4.0 under Windows 7 64 Bit!

I can open the XML File, read and Close...

So far so good...

But after I Close the File the File is locking too because i have a STOP RUN !?

You can test it self:

Open Net Express 4.4 / 5.0 / 5.1

Open a Project with an XML File (open/read/close etc)

Let the Code run (Animate...)

After the Stop RUN........

--> Change any Line in your Cobol Code and make a rebuild

--> There you become an error!

--> The EXE File that you have use the last time ist NOT finish!?

Then i Close Net Express

And open Net Express with the same Project...

Make a rebuild an the changes form the last time is now complete...

I let the Animator running and it works....

Then again..

Change an Line and the EXE File was locked and the game start an "After the Stop RUN..."

ONE QUESTION:

Wich Firewall did you use?

Norton?


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

One more bug!?

After the last Windows Update i have nearly the same Problem (today) with Net Express 4.0 under Windows 7 64 Bit!

I can open the XML File, read and Close...

So far so good...

But after I Close the File the File is locking too because i have a STOP RUN !?

You can test it self:

Open Net Express 4.4 / 5.0 / 5.1

Open a Project with an XML File (open/read/close etc)

Let the Code run (Animate...)

After the Stop RUN........

--> Change any Line in your Cobol Code and make a rebuild

--> There you become an error!

--> The EXE File that you have use the last time ist NOT finish!?

Then i Close Net Express

And open Net Express with the same Project...

Make a rebuild an the changes form the last time is now complete...

I let the Animator running and it works....

Then again..

Change an Line and the EXE File was locked and the game start an "After the Stop RUN..."

ONE QUESTION:

Wich Firewall did you use?

Norton?


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

The only version of Net Express that is supported under Windows 7 is Net Express 5.1 so you should not be using Net Express 4.0 or 5.0 in that environment.

It sounds like something is keeping your file handles from being released after they are closed but I am not convinced that it has anything to do with Net Express.

Do you have a different computer on which Net Express is installed to see if it exhibits the same behavior?

Have you tried turning off your antivirus software to see if it is the cause of the problem?

I use Symantec Endpoint Protection here and I do not have this same problem.

Thanks.


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I have run the program with debugging.

The result is :

000000000

000000172

000000000

000000000

This is oke.

But the problem is not the making of a file but after the reading.

The result by reading the xml-file is :

000000000

000000001

000000000

000014657

The coding is :

     $set preprocess(prexml) endp

      id division.

      program-id.   readxml.

      environment division.

      input-output section.

      file-control.

          select customers assign to filename-xml

                           organization is xml

                           document-type is omitted

                           file status is xml-status.

      data division.

      file section.

      xd customers.

      01 customerdb identified by "customerdb"

         count in customerdb-count.

         05 customer-record identified by "customer-record"

            count in customer-record-count.

            10 customer-id pic X(5) identified by "customer-id"

               count in customer-id-count.

            10 customer-name pic X(20) identified by "customer-name"

               count in customer-name-count.

      working-storage section.

      01 xml-status   pic s9(9) value 0.

      01 old-name     pic x(100) .

      01 new-name     pic x(256) .

      01 filename-xml.

        03 deel-1     pic x(047) value

                     "K:\\applicaties\\egu\\egu_3.0\\r\\development\\batch\\".

        03 deel-2     pic x(036) value

                     "data\\export\\extern\\cak\\customers.xml".

      01 filename-new.

        03 deel-1     pic x(047) value

                     "K:\\applicaties\\egu\\egu_3.0\\r\\development\\batch\\".

        03 deel-2     pic x(036) value

                     "data\\export\\extern\\svb\\customers.xml".

      procedure division.

          move filename-xml to old-name

          move filename-new to new-name

          open input customers

          display xml-status

          read customers

          display xml-status

          close customers

          call "CBL_COPY_FILE" using old-name new-name

          display return-code

          call "CBL_DELETE_FILE" using old-name

          display return-code

          stop run.


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I can now reproduce the problem using the new example and it does appear that this is a bug in that the close statement does not release the file handle and the delete will fail.

This only appears to happen if OPEN INPUT is used.

If I change to use OPEN I-O instead then the example works ok so perhapos this is a workaround for you?

Can you please open up a support incident with customer care for this problem and put assign to Chris Glazier in the description.

I will then RPI it and we will work on getting a fix for this.

Thanks.


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

The incident number is 2664760


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

The incident number is 2664760


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I use the OPEN I-O as a workaround .


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I use the OPEN I-O as a workaround .


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I use the OPEN I-O as a workaround .


I have made a program for reading a XML-file.

I opened the file, control the data and close the file.

The "CBL_COPY_FILE" works but when I use "CBL_DELETE_FILE" it don't work.

When I use a not xml-file and copy and delete the file it works.

How can I solve this problem in one program.

Coding:

File-control.

           SELECT BER218
                                 ASSIGN       TO WS-ALGFILE-NAAM
                                 ORGANIZATION  IS XML
                                 DOCUMENT-TYPE IS omitted
                                 FILE STATUS   IS WS-ALGFILE-STATUS.

File section.

       XD BER218.
           COPY CAK218.

Procedure Division.

           CALL "CBL_COPY_FILE"
               USING WS-ALGFILE-NAAM WS-RINFO-NAAM
               RETURNING return-code

           RETURN-CODE = 0

           CALL "CBL_DELETE_FILE"
               USING WS-ALGFILE-NAAM
               RETURNING return-code

           RETURN-CODE <> 0
 


#COBOL

I had exactly the same problem (Incident 2666055)

Allthough very strange, but the workaround to open a file I-O that is used only for input  solved the problem.

Thanks  Rolf