473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Deleting records on different rows...

Jim
Hi all, having a problem with a database.

I have a feed from a mainframe that sends over data in the following
format, I've numbered the rows 1 through 8 for this message. Under
Entry 208, there is a begin, cancel, begin, and end record, along with
a time. I need to keep only the second Begin record (3) and the End
record (4); I'm not concerned about records 1 and 2. Some sort of
thing that finds a cancel record, and deletes the prior begin record...
but I'm not sure how.

Similarly, with Entry 0232, I want to keep record 5 and 8, but delete
record 6 and 7... Does anyone have an idea how this could be done?

Entry Type Time OprCycleSort
1 0208 BEGIN 041417 6 050 093=39=SRT
2 0208 CANCEL 041459 $.00 0
3 0208 BEGIN 041509 6 050 093=39=SRT
4 0208 END 041718 $368,521.94 68

5 0232 BEGIN 085809 6 050 086=02=41B
6 0232 SUSPEND 090528 $.00 0
7 0232 RESTART 090530 6 050 086=02=41B
8 0232 END 091658 $22,433,881.48 3,343

Nov 13 '05 #1
1 1165
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Probably have to read the data sequentially parsing as you go. E.g.:

If "begin"
Read & hold data lines until hit "end"
If hit "cancel"
Drop held data lines
If hit "end"
Place held data lines into storage
Repeat until end of data stream

The "held data lines" can be saved in a variable or a table until done,
then saved to a file/table or something else.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQedOHIechKqOuFEgEQIt0QCbBBveBTNJciTPtQy1ZjAD1c qnjeQAn2RR
6aN9oce7ZcHXRnL3V5xCtK35
=eCfx
-----END PGP SIGNATURE-----
Jim wrote:
Hi all, having a problem with a database.

I have a feed from a mainframe that sends over data in the following
format, I've numbered the rows 1 through 8 for this message. Under
Entry 208, there is a begin, cancel, begin, and end record, along with
a time. I need to keep only the second Begin record (3) and the End
record (4); I'm not concerned about records 1 and 2. Some sort of
thing that finds a cancel record, and deletes the prior begin record...
but I'm not sure how.

Similarly, with Entry 0232, I want to keep record 5 and 8, but delete
record 6 and 7... Does anyone have an idea how this could be done?

Entry Type Time OprCycleSort
1 0208 BEGIN 041417 6 050 093=39=SRT
2 0208 CANCEL 041459 $.00 0
3 0208 BEGIN 041509 6 050 093=39=SRT
4 0208 END 041718 $368,521.94 68

5 0232 BEGIN 085809 6 050 086=02=41B
6 0232 SUSPEND 090528 $.00 0
7 0232 RESTART 090530 6 050 086=02=41B
8 0232 END 091658 $22,433,881.48 3,343

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rishi | last post by:
Looking for tips on how to improve performance on deleting records. In our database we do dataloads daily that require us to purge millions of records a day so any improvement in speed would be...
5
by: Alex | last post by:
Hi, I have two tables , A and B where table B has a foreign key constraint to table A. I want to delete all records in table A that are older than a certain date that are not referenced by...
1
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
5
by: Mojtaba Faridzad | last post by:
Hi, with SetDataBinding( ) a DataGrid shows a DataView. user can select some rows in the grid by holding cotrol key. when user clicks on Delete button, I should delete all selected rows. I am...
3
by: Chris Thunell | last post by:
I am trying to delete all the records in a table, but I keep getting a system.data.dbconcurrency exception. Is there an easy was to delete all the records in a sql table? Here is my code... i...
5
by: Robert Brown | last post by:
Hi All. I have a routine that checks a SQL Table for all records 3 months prior to a predetermined date, then I insert them into an Archive DB then delete those records from the original table....
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
9
by: Hamed | last post by:
Hello I have a DataGrid that a is bound to a DataTable. Some of the rows in the DataTable should not be deleted. How can I prohibit deleting of some identified rows? The problem could be...
7
by: Susan Mackay | last post by:
I have a data table that is connected to a database table with a data adapter in the 'standard' manner. However I want to be able to remove selected rows from the data table (i.e. no longer...
24
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.