View previous topic :: View next topic |
Author |
Message |
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 8:23 am Post subject: Question on record reading and deleting |
|
|
Hi,
I have few questions...please help me in getting answers for these!!
1. is it possible to delete a record from a Flat file.
2. can you suggest me a VSAM file which can handle duplicate records. and allow us to delete the record after it reading that perticular record.
Thanks
Suma |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu May 24, 2007 8:30 am Post subject: |
|
|
1 - yes - but you cannot use a PS file - you need a regional file.
2 - any non-keyed e.g ESDS VSAM file would allow duplicates. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 8:33 am Post subject: |
|
|
Nic Clouston,
please let me what is a regional file?
Thanks
Suma |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 8:48 am Post subject: |
|
|
Kolusu,
I know that we can logically delete the record from the ESDS file. I tried to use ESDS VSAM file in my program, in this program I am deleting the alaready red records.
but when I try to compile I am getting error which is shown below...
1040 IKF4050I-E SYNTAX REQUIRES VSAM FILE . FOUND DNM=2-83 . STATEMENT DISCARDED.
I have defined the file like this..
SELECT FI-FILE-IN ASSIGN TO B8290210
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS VSAM-STATUS1.
FD FI-FILE-IN
BLOCK CONTAINS 0 RECORDS
RECORD CONTAINS 108 CHARACTERS
LABEL RECORDS ARE STANDARD
OPEN I-O FI-FILE-IN.
and delete statement like this...
DELETE FI-DLY-PAYMENT-FILE-IN.
please review and let me know where is problem in defining the file.....
thanks
Suma |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 24, 2007 8:58 am Post subject: |
|
|
Quote: |
1040 IKF4050I-E SYNTAX REQUIRES VSAM FILE . FOUND DNM=2-83 . STATEMENT DISCARDED.
|
suma,
That is NOT a mainframe COBOL error message. Cobol error messages start with IGY....
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 9:04 am Post subject: |
|
|
Kolusu,
May it is due to our shop is using a old compilers...
Thanks
Suma |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 24, 2007 9:05 am Post subject: |
|
|
Quote: |
Kolusu,
May it is due to our shop is using a old compilers...
|
No matter how old the compiler is that is NOT a mainframe COBOL error message
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu May 24, 2007 9:08 am Post subject: |
|
|
No - I think IGY has been around for many years. If youor compiler is older than that then it is unsupported and does not have many of the new keywords - gor example EVALUATE and EXEC-SQL which are themselves quite old but not THAT old. I also did a search on Google for that message id and came up with no hits. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 9:11 am Post subject: |
|
|
Kolusu,
Thanks for your quick reply...
Please let me know ORGANIZATION I have to use for defining ESDS file in SELECT statement...
thanks
Suma |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 24, 2007 9:21 am Post subject: |
|
|
Quote: |
Please let me know ORGANIZATION I have to use for defining ESDS file in SELECT statement...
|
suma,
I have NO clue as to what your cobol compiler is and you expect me to help you?
If I had to take a wild guess then try this
Quote: | SELECT FI-FILE-IN ASSIGN TO AS-B8290210 |
For ESDS files you need AS clause on the SELECT statement
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
|
Back to top |
|
|
suma Beginner
Joined: 23 Jan 2006 Posts: 65 Topics: 29
|
Posted: Thu May 24, 2007 9:33 am Post subject: |
|
|
Thanks for your help..
finally I got this error...I think we cann't delete a record from a file....
1041 IGYPA3026-S "ORGANIZATION" of file "FI-FILE-IN" was not
VSAM "RELATIVE" or "INDEXED". The "DELETE" statement was discarded
Is there any way we can delete records from a file. that file should handle duplicates?
Thanks
suma |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu May 24, 2007 9:44 am Post subject: |
|
|
unload it to a PS file and process that writing out all the records you want to keep. Then load them up again. You would have to do soemthing similar, I believe, because if you could delete the record while processing as a VSAM file you would not be able to reuse the space. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|