IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Deleting all Records from CICS Online KSDS File


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
roykpc

New User


Joined: 27 Nov 2009
Posts: 2
Location: Kolkata

PostPosted: Mon Feb 22, 2010 1:09 pm
Reply with quote

Hi.

I want to Delete all records present in a CICS KSDS File from a C Online program.
There are 2 scenarios.

1) File1
LRECL = 93
KEYL = 11 from Position 7
KEY type is Alphabetic.
I was trying to Use the GENERIC Option, but there is no Common part in any of the keys.

1) File2
LRECL = 93
KEYL = 01 from Position 40
KEY type is Alphabetic.
I was trying to Use the GENERIC Option, but there is no Common part in any of the keys.

Though I have to code it in C, a solution in COBOL will also be helpful. I will port the code to C.

Thanks and Regards,
Kingshuk
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Mon Feb 22, 2010 5:07 pm
Reply with quote

Hi Kingshuk,

Since you have not mentioned any specific requirements I hope deleting records one by one should be okay - using the CICS READNEXT UPDATE and CICS DELETE commands.... icon_razz.gif

I know this aint a good solution... icon_wink.gif ... and most probably you would be looking for a single command to do it.
I am also not aware if we can do it in a single command. Hopefully some one might provide the solution.. icon_smile.gif

As of now since you dont have a common part in any of the keys, I suggest you could add a new one byte field as the first field in the key for both the files and based on this field probably you could do the deletion.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Mar 02, 2010 3:30 am
Reply with quote

Quote:
I was trying to Use the GENERIC Option, but there is no Common part in any of the keys.

How did you try using GENERIC option? Can you please elaborate?

Take one first byte of the key field and try delete command with all possible combinations for that byte. As your key is alphabetic, try values A through Z.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Mar 02, 2010 2:54 pm
Reply with quote

Define the KSDS as REUSABLE do a "fopen" with "wb(+)"

Open for writing. If the cluster is defined as reusable, the existing contents of the cluster are destroyed. If the cluster is defined as not reusable (clusters with paths are, by definition, not reusable), fopen() fails. However, if the cluster has been defined but not loaded, this mode can be used to do the initial load of both reusable and non reusable clusters.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top