DELETE not working 
Author Message
 DELETE not working

Hi all:

Can any one please help me on this. I have a program that reads the file
based on a certain criteria and deletes the records.

Though the READ is successful, the DELETE fails with a FILE-STATUS error 23.
It just hits us why, we tried all the possible means, but not able to solve
this.

Appreciate your help on this.

Thanks in advance,
Shyam



Sat, 12 Nov 2005 21:31:40 GMT  
 DELETE not working

Quote:

>Hi all:

>Can any one please help me on this. I have a program that reads the file
>based on a certain criteria and deletes the records.

This sounds odd... please post the READ and DELETE statements for a
starter.

DD



Sat, 12 Nov 2005 21:32:24 GMT  
 DELETE not working

I have attached the file with this mail, please help

       IDENTIFICATION DIVISION.
       PROGRAM-ID.                IDXFILE-ASCII.
       AUTHOR.                    DGS.
       DATE-WRITTEN.              110403.
      *
      *******************************************************************
      *                                                                 *
      *******************************************************************
      *
       ENVIRONMENT DIVISION.
      *
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.           HP-UX.
       OBJECT-COMPUTER.           HP-UX.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT IDXFILE-INC  ASSIGN TO  "IDXFILE"
                   ORGANIZATION INDEXED
                   ACCESS MODE IS DYNAMIC
                   RECORD KEY IS IDXF-KEY.

     /
       DATA DIVISION.
      *-------------
      *
       FILE SECTION.
      *
       FD  IDXFILE-INC
           LABEL RECORD STANDARD.
      *
       01  IDXFILE-REC.
           05  IDXF-KEY.
               10  IDXF-CHRG-ID                     PIC X(16).
               10  IDXF-START-DATE                  PIC S9(8) COMP-3.
               10  IDXF-START-TIME                  PIC S9(6) COMP-3.
           05  IDXF-DATA.
               10  IDXF-END-DATE                    PIC S9(8)  COMP.
               10  IDXF-END-TIME                    PIC S9(8)  COMP.
               10  IDXF-CHRG-TYPE                   PIC X.
                   88 IDXF-CHRG-CALLING             VALUE "G".
                   88 IDXF-CHRG-CALLEE              VALUE "D".
               10  IDXF-CALLER-ID                   PIC X(16).
               10  IDXF-CALLEE-ID                   PIC X(16).
               10  IDXF-DURATION                    PIC S9(9)  COMP.
               10  IDXF-USAGE-TYPE-FWD              PIC X(3).
                   88 IDXF-CBR-FWD                  VALUE "CBR".
                   88 IDXF-VBR-FWD                  VALUE "VBR".
                   88 IDXF-UBR-FWD                  VALUE "UBR".
               10  IDXF-USAGE-TYPE-BWD              PIC X(3).
                   88 IDXF-CBR-BWD                  VALUE "CBR".
                   88 IDXF-VBR-BWD                  VALUE "VBR".
                   88 IDXF-UBR-BWD                  VALUE "UBR".
               10  IDXF-TRFF-VOLUME-FWD             PIC S9(9)  COMP.
               10  IDXF-TRFF-VOLUME-BWD             PIC S9(9)  COMP.
               10  IDXF-VOLUME-USAGE-FWD            PIC S9(9)  COMP.
               10  IDXF-VOLUME-USAGE-BWD            PIC S9(9)  COMP.
               10  IDXF-CALL-REF                    PIC 9(5).
               10  IDXF-SEQ-NUM                     PIC 9(10).
               10  IDXF-USER-PLANE                  PIC X(1).
               10  IDXF-TAGGING-FWD                 PIC X(1).
               10  IDXF-TAGGING-BWD                 PIC X(1).
               10  IDXF-REJ-CODE                    PIC X(1).
               10  IDXF-STATUS                      PIC X(1).
                   88 IDXF-REJ-PENDING              VALUE "P".
                   88 IDXF-REJ-RECYCLE              VALUE "R".
                   88 IDXF-REJ-DELETE               VALUE "D".
      *
       WORKING-STORAGE SECTION.
      *
       77 ERROR-FLAG-1-W PIC X VALUE 'N'.
       01  WS-IDXF-KEY.
               10  WS-IDXF-CHRG-ID                     PIC X(16).
               10  WS-IDXF-START-DATE                  PIC S9(8) COMP-3.
               10  WS-IDXF-START-TIME                  PIC S9(6) COMP-3.
       PROCEDURE DIVISION.
       MAIN-PARA.
           PERFORM OPEN-FILES     THRU  OPEN-FILES-EXIT.
           MOVE "N" TO ERROR-FLAG-1-W.
           PERFORM START-PARA     THRU  START-PARA-EXIT.
           IF ERROR-FLAG-1-W = "N"
           PERFORM PROCESS-PARA  THRU  PROCESS-EXIT.
           PERFORM CLOSE-PARA.
           STOP RUN.
       OPEN-FILES.
            OPEN  I-O  IDXFILE-INC.
      *
       OPEN-FILES-EXIT.
            EXIT.
       START-PARA.
            MOVE  LOW-VALUE        TO       IDXF-KEY.
            START IDXFILE-INC KEY NOT LESS THAN IDXF-KEY
                  INVALID KEY DISPLAY "** No record found: AT05 "

            MOVE "Y" TO ERROR-FLAG-1-W.
                DISPLAY "AFTER START", IDXF-CHRG-ID.
                DISPLAY IDXF-START-DATE.
                DISPLAY IDXF-START-TIME.

       START-PARA-EXIT.
           EXIT.

       PROCESS-PARA.
           MOVE "008521972590023F" TO WS-IDXF-CHRG-ID.
           MOVE 20030419 TO WS-IDXF-START-DATE.
           MOVE 185546 TO WS-IDXF-START-TIME.
                   MOVE WS-IDXF-KEY to IDXF-KEY.
      *    READ IDXFILE-INC NEXT RECORD
      *         AT END
      *         GO TO PROCESS-EXIT.
                DISPLAY  "AFTER READ", IDXF-CHRG-ID.
                DISPLAY IDXF-START-DATE.
                DISPLAY IDXF-START-TIME.
           DELETE IDXFILE-INC RECORD
            INVALID KEY
                    DISPLAY IDXF-CHRG-ID
                    DISPLAY IDXF-START-DATE
                    DISPLAY  IDXF-START-TIME
               DISPLAY "DELETE IDXFILE-REC ERROR "
                       ", KEY : " IDXF-KEY.

       PROCESS-EXIT.
           EXIT.
       CLOSE-PARA.
           CLOSE IDXFILE-INC.

Regds..Shyam

Quote:



> >Hi all:

> >Can any one please help me on this. I have a program that reads the file
> >based on a certain criteria and deletes the records.

> This sounds odd... please post the READ and DELETE statements for a
> starter.

> DD



Sat, 12 Nov 2005 23:23:07 GMT  
 DELETE not working


:>Can any one please help me on this. I have a program that reads the file
:>based on a certain criteria and deletes the records.

:>Though the READ is successful, the DELETE fails with a FILE-STATUS error 23.
:>It just hits us why, we tried all the possible means, but not able to solve
:>this.

Did you confirm the value of the record key?

Perhaps the value was overlayed?

--

http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel



Sat, 12 Nov 2005 23:22:09 GMT  
 DELETE not working
Yes, I infact changed the program to do a READ Exact before the DELETE
operation and displayed the record on the screen. It executes it
successfully. But the moment, the DELETE operation is encountered, it comes
out with 23 error.

Surprises me......

Please help. SOS.

Regds..Shyam


Quote:


> :>Can any one please help me on this. I have a program that reads the file
> :>based on a certain criteria and deletes the records.

> :>Though the READ is successful, the DELETE fails with a FILE-STATUS error
23.
> :>It just hits us why, we tried all the possible means, but not able to
solve
> :>this.

> Did you confirm the value of the record key?

> Perhaps the value was overlayed?

> --

> http://www.dissensoftware.com

> Director, Dissen Software, Bar & Grill - Israel



Sat, 12 Nov 2005 23:42:17 GMT  
 DELETE not working
On Tue, 27 May 2003 15:23:07 GMT, "Shyam"

Snip

Quote:
>                   MOVE WS-IDXF-KEY to IDXF-KEY.
>      *    READ IDXFILE-INC NEXT RECORD
>      *         AT END
>      *         GO TO PROCESS-EXIT.

The read lines are commented. Try and remove the "*" and come back to
us
Quote:
>                DISPLAY  "AFTER READ", IDXF-CHRG-ID.
>                DISPLAY IDXF-START-DATE.
>                DISPLAY IDXF-START-TIME.
>           DELETE IDXFILE-INC RECORD
>            INVALID KEY

Snip

FF
Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com



Sun, 13 Nov 2005 01:48:56 GMT  
 DELETE not working


I have attached the file with this mail, please help

       IDENTIFICATION DIVISION.
       PROGRAM-ID.                IDXFILE-ASCII.
       AUTHOR.                    DGS.
       DATE-WRITTEN.              110403.
      *
      *******************************************************************
      *                                                                 *
      *******************************************************************
      *
       ENVIRONMENT DIVISION.
      *
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.           HP-UX.
       OBJECT-COMPUTER.           HP-UX.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT IDXFILE-INC  ASSIGN TO  "IDXFILE"
                   ORGANIZATION INDEXED
                   ACCESS MODE IS DYNAMIC
                   RECORD KEY IS IDXF-KEY.

     /
       DATA DIVISION.
      *-------------
      *
       FILE SECTION.
      *
       FD  IDXFILE-INC
           LABEL RECORD STANDARD.
      *
       01  IDXFILE-REC.
           05  IDXF-KEY.
               10  IDXF-CHRG-ID                     PIC X(16).
               10  IDXF-START-DATE                  PIC S9(8) COMP-3.
               10  IDXF-START-TIME                  PIC S9(6) COMP-3.
           05  IDXF-DATA.
               10  IDXF-END-DATE                    PIC S9(8)  COMP.
               10  IDXF-END-TIME                    PIC S9(8)  COMP.
               10  IDXF-CHRG-TYPE                   PIC X.
                   88 IDXF-CHRG-CALLING             VALUE "G".
                   88 IDXF-CHRG-CALLEE              VALUE "D".
               10  IDXF-CALLER-ID                   PIC X(16).
               10  IDXF-CALLEE-ID                   PIC X(16).
               10  IDXF-DURATION                    PIC S9(9)  COMP.
               10  IDXF-USAGE-TYPE-FWD              PIC X(3).
                   88 IDXF-CBR-FWD                  VALUE "CBR".
                   88 IDXF-VBR-FWD                  VALUE "VBR".
                   88 IDXF-UBR-FWD                  VALUE "UBR".
               10  IDXF-USAGE-TYPE-BWD              PIC X(3).
                   88 IDXF-CBR-BWD                  VALUE "CBR".
                   88 IDXF-VBR-BWD                  VALUE "VBR".
                   88 IDXF-UBR-BWD                  VALUE "UBR".
               10  IDXF-TRFF-VOLUME-FWD             PIC S9(9)  COMP.
               10  IDXF-TRFF-VOLUME-BWD             PIC S9(9)  COMP.
               10  IDXF-VOLUME-USAGE-FWD            PIC S9(9)  COMP.
               10  IDXF-VOLUME-USAGE-BWD            PIC S9(9)  COMP.
               10  IDXF-CALL-REF                    PIC 9(5).
               10  IDXF-SEQ-NUM                     PIC 9(10).
               10  IDXF-USER-PLANE                  PIC X(1).
               10  IDXF-TAGGING-FWD                 PIC X(1).
               10  IDXF-TAGGING-BWD                 PIC X(1).
               10  IDXF-REJ-CODE                    PIC X(1).
               10  IDXF-STATUS                      PIC X(1).
                   88 IDXF-REJ-PENDING              VALUE "P".
                   88 IDXF-REJ-RECYCLE              VALUE "R".
                   88 IDXF-REJ-DELETE               VALUE "D".
      *
       WORKING-STORAGE SECTION.
      *
       77 ERROR-FLAG-1-W PIC X VALUE 'N'.
       01  WS-IDXF-KEY.
               10  WS-IDXF-CHRG-ID                     PIC X(16).
               10  WS-IDXF-START-DATE                  PIC S9(8) COMP-3.
               10  WS-IDXF-START-TIME                  PIC S9(6) COMP-3.
       PROCEDURE DIVISION.
       MAIN-PARA.
           PERFORM OPEN-FILES     THRU  OPEN-FILES-EXIT.
           MOVE "N" TO ERROR-FLAG-1-W.
           PERFORM START-PARA     THRU  START-PARA-EXIT.
           IF ERROR-FLAG-1-W = "N"
           PERFORM PROCESS-PARA  THRU  PROCESS-EXIT.
           PERFORM CLOSE-PARA.
           STOP RUN.
       OPEN-FILES.
            OPEN  I-O  IDXFILE-INC.
      *
       OPEN-FILES-EXIT.
            EXIT.
       START-PARA.
            MOVE  LOW-VALUE        TO       IDXF-KEY.
            START IDXFILE-INC KEY NOT LESS THAN IDXF-KEY
                  INVALID KEY DISPLAY "** No record found: AT05 "

            MOVE "Y" TO ERROR-FLAG-1-W.
                DISPLAY "AFTER START", IDXF-CHRG-ID.
                DISPLAY IDXF-START-DATE.
                DISPLAY IDXF-START-TIME.

       START-PARA-EXIT.
           EXIT.

       PROCESS-PARA.
           MOVE "008521972590023F" TO WS-IDXF-CHRG-ID.
           MOVE 20030419 TO WS-IDXF-START-DATE.
           MOVE 185546 TO WS-IDXF-START-TIME.
                   MOVE WS-IDXF-KEY to IDXF-KEY.
      *    READ IDXFILE-INC NEXT RECORD
      *         AT END
      *         GO TO PROCESS-EXIT.
                DISPLAY  "AFTER READ", IDXF-CHRG-ID.
                DISPLAY IDXF-START-DATE.
                DISPLAY IDXF-START-TIME.
           DELETE IDXFILE-INC RECORD
            INVALID KEY
                    DISPLAY IDXF-CHRG-ID
                    DISPLAY IDXF-START-DATE
                    DISPLAY  IDXF-START-TIME
               DISPLAY "DELETE IDXFILE-REC ERROR "
                       ", KEY : " IDXF-KEY.

       PROCESS-EXIT.
           EXIT.
       CLOSE-PARA.
           CLOSE IDXFILE-INC.
----------

1. You know of course your read statement is commented?
2. How do you know you get a return of '23'? You're not trapping the file
status value.
3. Maybe the record is actually NOT THERE in which case the DELETE fail
makes sense.



Sun, 13 Nov 2005 04:41:49 GMT  
 DELETE not working

Quote:

>        PROCESS-PARA.
>            MOVE "008521972590023F" TO WS-IDXF-CHRG-ID.
>            MOVE 20030419 TO WS-IDXF-START-DATE.
>            MOVE 185546 TO WS-IDXF-START-TIME.
>                    MOVE WS-IDXF-KEY to IDXF-KEY.
>       *    READ IDXFILE-INC NEXT RECORD
>       *         AT END
>       *         GO TO PROCESS-EXIT.
>                 DISPLAY  "AFTER READ", IDXF-CHRG-ID.
>                 DISPLAY IDXF-START-DATE.
>                 DISPLAY IDXF-START-TIME.
>            DELETE IDXFILE-INC RECORD
>             INVALID KEY
>                     DISPLAY IDXF-CHRG-ID
>                     DISPLAY IDXF-START-DATE
>                     DISPLAY  IDXF-START-TIME
>                DISPLAY "DELETE IDXFILE-REC ERROR "
>                        ", KEY : " IDXF-KEY.

You do realize that the READ is commented out, right?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~   /   \  /                Live from Montgomery, AL!     ~
~  /     \/       o                                       ~
~ /      /\   -   |       AIM:  LXi0007                   ~
~ _____ /  \      |    E-mail:  DanielJS "at" Knology.net ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove NOSPAM to e-mail me...



Sun, 13 Nov 2005 07:04:12 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. mail.delete not working

2. Insert, change, delete with toolbar does not work

3. File Delete does not work in W2000

4. Deleted procs not deleted???

5. delete or not to delete

6. Does not work with TPS but works with DBF

7. 5.2 Network application works with 95, does not work with 98

8. Does the Autosave works in Excel , if not how to make it work in my program

9. Work library not same as current working library

10. REALdatabase not null and primary key not working

11. NOT Allow Inserts not working

12. Q: (IF WS-VAR NOT = SPACE) does not work in DBCS context

 

 
Powered by phpBB® Forum Software