Sponsored Content
Top Forums Shell Programming and Scripting Help identifying transactions with no detail lines Post 302422550 by rookie12 on Tuesday 18th of May 2010 05:45:38 PM
Old 05-18-2010
CPU & Memory Help identifying transactions with no detail lines

Wondering if someone can help with my task of identifying missing detail lines in transactions.

I have a flat file that contains transaction header, transaction detail, and transaction trailer lines. These lines are identified with a 5-character line identifier "THEAD", "TDETL", and "TTAIL" at the beginning of the line. Similar to this:

Code:
THEAD000000000200000000
TDETL0000000003000000Good
TTAIL0000000004000000

How can I identify which transactions have missing TDETL lines?
In other words, a missing TDETL transaction is one where there is a THEAD and then TTAIL right after on the next line without a TDETL line in between. Here is one such example:

Code:
THEAD000000000200000000
TTAIL0000000003000000

In those conditions, I'd like to print out the THEAD lines to a text file as well as the file name that the missing TDETL transaction was found in as I will be running this script against 1000s of files.

Is SED or GREP the proper tools to use? What would be the best way to go about this?

Last edited by vgersh99; 05-18-2010 at 06:56 PM.. Reason: code tags, please!
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting detail out of a log file...

I'd like to peruse a log file and from it generate another file from the first instance of "Jul 11" to the first instance of "Jul 18" within the log file. (3 Replies)
Discussion started by: Cameron
3 Replies

2. UNIX for Advanced & Expert Users

what does metaroot in detail?

I have a problem with a submirror of the root filesystem, in the procedure in order to unmirror the FS say: metadetach -f d0 d20 metaroot c0t0d0s0 but, in my system the metaroot cause a segmentation fault coredump. I knew that the command modify the /etc/system and the /etc/vfstab. I try... (3 Replies)
Discussion started by: hugo_perez
3 Replies

3. Cybersecurity

Check login detail

As a root user i switch to a different user say "oratest". I would like to know the details like at what time did the switch ( su - oratest ) happen. Are there any logs to check this Thanks. (2 Replies)
Discussion started by: jjoy
2 Replies

4. Shell Programming and Scripting

Append transaction header lines to same transaction's detail lines

Hi guys, I was wondering if someone can give me a hand in helping me append transaction header line in a file at the end of the transaction detail lines. Basically, I have a file that looks like this: FHEAD File1 THEAD TRANS1-blah TDETL HI1 TDETL HI2 TDETL HI3 TTAIL TRANS1-blah THEAD... (3 Replies)
Discussion started by: rookie12
3 Replies

5. Shell Programming and Scripting

Script to take count of transactions

Hello All, I have written a script which i run on admin server to display the count of transaction on rest of the service blades. here is the code s='' if then s=$1 fi if then TPS=`on tswebpxmp1 snmpget -c public -v 2c 127.0.0.1:1610 1.3.6.1.4.1.12702.9.2.6.2.0 |... (0 Replies)
Discussion started by: Siddheshk
0 Replies

6. UNIX for Advanced & Expert Users

Need to get the time difference for all the transactions in a day

Hello Experts, I need to evaluate my API performance, so need a script to get the time difference for all the transaction that has gone through my application in a day. The challenge is the multi threaded logs, so I cant just get all the Telephone Numbers and check the entering and existing... (5 Replies)
Discussion started by: samjna
5 Replies

7. Solaris

Tape Drive Detail

Hi, I am using HP Ultarium Tape drive to backup my oracle DB. Is that any command to identify the tape serial number or any other tape details that inserted into the tape drive? (2 Replies)
Discussion started by: tharmendran
2 Replies
PREPARE 
TRANSACTION(7) SQL Commands PREPARE TRANSACTION(7) NAME
PREPARE TRANSACTION - prepare the current transaction for two-phase commit SYNOPSIS
PREPARE TRANSACTION transaction_id DESCRIPTION
PREPARE TRANSACTION prepares the current transaction for two-phase commit. After this command, the transaction is no longer associated with the current session; instead, its state is fully stored on disk, and there is a very high probability that it can be committed success- fully, even if a database crash occurs before the commit is requested. Once prepared, a transaction can later be committed or rolled back with COMMIT PREPARED [commit_prepared(7)] or ROLLBACK PREPARED [roll- back_prepared(7)], respectively. Those commands can be issued from any session, not only the one that executed the original transaction. From the point of view of the issuing session, PREPARE TRANSACTION is not unlike a ROLLBACK command: after executing it, there is no active current transaction, and the effects of the prepared transaction are no longer visible. (The effects will become visible again if the transaction is committed.) If the PREPARE TRANSACTION command fails for any reason, it becomes a ROLLBACK: the current transaction is canceled. PARAMETERS
transaction_id An arbitrary identifier that later identifies this transaction for COMMIT PREPARED or ROLLBACK PREPARED. The identifier must be written as a string literal, and must be less than 200 bytes long. It must not be the same as the identifier used for any currently prepared transaction. NOTES
This command must be used inside a transaction block. Use BEGIN [begin(7)] to start one. It is not currently allowed to PREPARE a transaction that has executed any operations involving temporary tables, created any cursors WITH HOLD, or executed LISTEN or UNLISTEN. Those features are too tightly tied to the current session to be useful in a transaction to be pre- pared. If the transaction modified any run-time parameters with SET (without the LOCAL option), those effects persist after PREPARE TRANSACTION, and will not be affected by any later COMMIT PREPARED or ROLLBACK PREPARED. Thus, in this one respect PREPARE TRANSACTION acts more like COMMIT than ROLLBACK. All currently available prepared transactions are listed in the pg_prepared_xacts system view. Caution: It is unwise to leave transactions in the prepared state for a long time. This will interfere with the ability of VACUUM to reclaim storage, and in extreme cases could cause the database to shut down to prevent transaction ID wraparound (see in the documentation). Keep in mind also that the transaction continues to hold whatever locks it held. The intended usage of the feature is that a pre- pared transaction will normally be committed or rolled back as soon as an external transaction manager has verified that other data- bases are also prepared to commit. If you have not set up an external transaction manager to track prepared transactions and ensure they get closed out promptly, it is best to keep the prepared-transaction feature disabled by setting max_prepared_transactions to zero. This will prevent accidental creation of prepared transactions that might then be forgotten and eventually cause problems. EXAMPLES
Prepare the current transaction for two-phase commit, using foobar as the transaction identifier: PREPARE TRANSACTION 'foobar'; SEE ALSO
COMMIT PREPARED [commit_prepared(7)], ROLLBACK PREPARED [rollback_prepared(7)] SQL - Language Statements 2010-05-14 PREPARE TRANSACTION(7)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy