I have a situation where I have to process each record in update time stamp order, looking for TD record, if I find one, read a future TD (greater than current timestamp with a different status code) OR a TR record with no route status for the same trans# - if I find one, take that update timestamp date, and add as an attribute to the TD row as a new column - if I don't find any, this new column will be default date - once you do that, to calculate the work days - you subtract update timestamp date from the new column date (excluding default date).
Basically, I am trying to find out how many days a status stayed for a transaction till it changes or the transaction was closed (TR status). Appreciate any help!
Here is a sample
Trans 1 TD T8QC1 1/5/21
Trans 1 TD T8QC1 1/5/21 – no date to prior row
Trans 1 TD T8QC1 1/8/21 – no date to prior row
Trans 1 TD T9QC1 1/10/21 – when this happens, calculate days worked as 5 days and allocate to the first instance of D8QC1
Trans 1 TD T9QC1 1/12/21 – no date to prior row
Trans 1 TR blank 1/14/21 – when this happens, calculate days worked as 4 days and allocate to first instance of T9QC1
Reading subsequent rows in a query in DB2.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Reading subsequent rows in a query in DB2.
duplicate, posted and answered on ibmmainframes
locked, will deleted in a few days
locked, will deleted in a few days
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Similar Topics
- Replies
- Views
- Last post
-
-
RC16 upon subsequent calls "Address LINKMVS ICEMAN"
by golemis » Thu May 27, 2021 6:07 pm » in CLIST & REXX - 2
- 2145
-
by golemis
View the latest post
Thu May 27, 2021 8:30 pm
-
-
- 6
- 4408
-
by MemoPerez
View the latest post
Tue Oct 24, 2023 10:07 pm
-
- 3
- 1560
-
by sergeyken
View the latest post
Thu May 13, 2021 1:07 am
-
- 5
- 1747
-
by willy jensen
View the latest post
Fri Dec 03, 2021 8:16 pm
-
- 3
- 3791
-
by sergeyken
View the latest post
Thu Mar 25, 2021 7:12 pm