MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on record reading and deleting
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 8:23 am    Post subject: Question on record reading and deleting Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 24, 2007 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 8:33 am    Post subject: Reply with quote

suma,

1. Check this link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10.1?DT=20020923143836

2. search for "duplicates" in the same manual and look up sections which refers "alternate index"

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 8:33 am    Post subject: Reply with quote

Nic Clouston,

please let me what is a regional file?


Thanks
Suma
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 24, 2007 8:39 am    Post subject: Reply with quote

Check this out - it can be hard going - I was puzzling over something in it last night - not sure if it is an error or just bad presentation. However, it tells you all about various data set organisations.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/C2714572/6.0?DT=20020918091353
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 8:48 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 8:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 9:04 am    Post subject: Reply with quote

Kolusu,

May it is due to our shop is using a old compilers...


Thanks
Suma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 24, 2007 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 9:11 am    Post subject: Reply with quote

Kolusu,
Thanks for your quick reply...

Please let me know ORGANIZATION I have to use for defining ESDS file in SELECT statement...

Sad
thanks
Suma
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 24, 2007 9:21 am    Post subject: Reply with quote

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? Sad

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
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 24, 2007 9:22 am    Post subject: Reply with quote

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10.2.1?DT=20020923143836#HDRDUP0629

shows you how to make your vsam esds dataset known to COBOL. I believe you need the SEQUENTIAL-AS-FILE to let COBOL know it is VSAM (but I could very well be wrong on that)
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu May 24, 2007 9:33 am    Post subject: Reply with quote

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? Sad

Thanks
suma
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu May 24, 2007 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group