Jump to content


Photo
- - - - -

DELETION IN ISAM FILE


9 replies to this topic

#1 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 26 January 2006 - 09:25 PM

Hi ,

i am trying to delete records in key file , but not able to .

it is a .PRO file.

lscall $delfile

in delfile

defalut logic : sel-only(first key field) this file has two key fields

file is in 'D' mode.


i didn't inderstand why the records are not getting deleted.


Pl. guide me here
Thanks & Regards,
Basy

#2 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 26 January 2006 - 09:49 PM

hey guys , let me check this , i will reply back, it seems the file has not data.
Thanks & Regards,
Basy

#3 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 27 January 2006 - 04:10 PM

Be sure to properly set the second key (initialize or set to first record you want to delete).

Lew

#4 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 27 January 2006 - 04:36 PM

i didn't know that isam file will have some default data. i have created a isam file and it has 3072 as size.

this made me to think that records are not getting deleetd.

But the problem is with records are not written into it.


"
How to read an isam file sequentially. i have assigned all key fields values "" and trying to read the file.

i am able to display UMsg IN BEFORE READ , but not able to display in after read no err and after read err.

control is going to exit logic directly after before read in the group. "

what can be the problem
Thanks & Regards,
Basy

#5 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 27 January 2006 - 05:49 PM

Is the file flagged as an auto-sequence (paging) file ?? Look at the file definition - this will tell you.
Things should be made as simple as possible, but not simpler

#6 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 27 January 2006 - 06:41 PM

I was doing sel-only for empty fields, this caused the problem.

removed sel-only from default logic and pro file is read sequentially
Thanks & Regards,
Basy

#7 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 27 January 2006 - 06:42 PM

Sounds like your cycle (LS) is set for one time. Remove the one time setting if it is set.

Lew

#8 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 27 January 2006 - 09:11 PM

the US in report is not set to 'Y'.

one big Q for me is that


why i am not able to read pro files with partial key ( ie first field of two key fields- sel-only)

as i failed to do this , now i have removed sel-only from default logic.

can you guys pl. let me know, in what scnerios we can't do sel-only for pro file.
Thanks & Regards,
Basy

#9 Papa Lazarou

Papa Lazarou

    Member

  • Members
  • PipPip
  • 38 posts
  • Gender:Male
  • Location:Royston Vasey
  • Interests:Collecting wives, pegs.

Posted 28 January 2006 - 12:05 AM

Hi basy

Here's a quick guide then. appologies if any of it is stating the obvious, just trying to (quickly) cover the majority of cases for SEL-ONLY and SEL-PARTIAL :-

SEL-ONLY is used to select a specific record or sub-set of records.

For example. if we have a file with two keys and the following 4 records:

1) a, aa
2) a, ab
3) a, ba
4) b, a

If we set key1 to 'a' and do a SEL-ONLY(key1) then it will return records 1 to 3.
If we set key1 to 'b' and do the same, only record 4 will be returned.

The sel-only on the primary key in this case is returning a subset of data where the records match the 1st key value that we specified.


Now if we set key1 to 'a' and key2 to 'aa' and do a SEL-ONLY(key2) then only record 1 is returned. This is because in this case it is the only record that matches both keys.

If I understand correctly then in your example, you would have set key1 to '' and key2 to '' and performed a SEL-ONLY(key1). In this case no records would be returned as there are no records that match a blank 1st key. The second key is not even considered as it is not in the SEL-ONLY.


For partial reads, you can use SEL-PARTIAL instead of SEL-ONLY. SEL-PARTIAL will partially match the key that you give it and explicitly match any keys that are higher than it on the record.
For example, if we set key1 to 'a' and key2 to 'a' and do a SEL-PARTIAL(key2) we will get records 1 and 2. PROIV will select all records that explicitly match key1 ('a') and partially match key2 ('aa' and 'ab' match the partial string 'a').
If we just set key1 to 'a' and SEL-PARTIAL(key1) then this time we will get records 1,2 and 3.
If we set key1 to 'a' and key2 to '' and SEL-PARTIAL(key2) we will get the same result - records 1,2 and 3 explicitly match key1='a' and partially match key2 of ''.

If we set both keys to '' and do a SEL-PARTIAL on key2 then this time we don't get any data. Maybe that's not what you guessed. The reason is that PROIV will select records with the first key matching '' and a partial second key of ''. There aren't any with a '' first key of course! Doing a SEL-PARTIAL on key2 in this case is actually just the same as doing a SEL-ONLY(key1).

If we set key1 to '' and requested SEL-PARTIAL(key1) though, well we'd get ALL records. This is because they all partially match an empty 1st key. This btw is the default selection behaviour of a cycle, and is the same as if there were no logic at all.

Anyway, that was a pretty quick example so hope it makes sense! (& I've not made any typos!)

HTH :)
You're my wife now, Dave!

#10 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 30 January 2006 - 08:26 PM

Thanks HTH for the detail description. It served the purpose.
Thanks & Regards,
Basy



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users