View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi there,
My Requirement is as follows:
Input File looks like follows:
Code: |
Branch-Id St-Date St-time End-Date End-Time Code
CITSK012 30/11/2011 20:00 30/11/2011 20:05 0
CITSK012 30/11/2011 20:01 30/11/2011 20:04 0
CITSK012 30/11/2011 20:10 30/11/2011 20:13 0
CITATKKV 30/11/2011 21:23 30/11/2011 21:44 0
CITATKKV 30/11/2011 21:34 30/11/2011 21:45 0
CITIOL01 30/11/2011 20:00 30/11/2011 20:05 0
CITIOL01 30/11/2011 20:01 30/11/2011 20:04 0
CITIOL02 30/11/2011 20:10 30/11/2011 20:13 0
CITIOL02 30/11/2011 21:23 30/11/2011 21:44 0
CITIOL02 30/11/2011 21:34 30/11/2011 21:45 0
CITIOL03 30/11/2011 21:47 30/11/2011 21:58 0
CITIOL03 30/11/2011 21:34 30/11/2011 21:34 0
CITIOL04 30/11/2011 21:33 30/11/2011 21:45 0
CITIOL04 30/11/2011 21:45 30/11/2011 21:56 0
CITIOL05 30/11/2011 21:34 30/11/2011 21:45 0
……….
CITIOL42 30/11/2011 23:55 1/12/2011 0:11 0
CITIOL42 30/11/2011 23:45 1/12/2011 0:01 0
CITIOL42 30/11/2011 23:56 1/12/2011 0:10 4
CITIOL42 30/11/2011 23:47 1/12/2011 23:56 0
CITBTDLS 30/11/2011 21:34 30/11/2011 21:34 0
CITBTDLS 30/11/2011 21:33 30/11/2011 21:45 0
CITBTWDS 30/11/2011 23:54 30/11/2011 23:59 0
CITBTWDS 30/11/2011 23:56 1/12/2011 0:10 4
CITBTWDS 30/11/2011 23:47 1/12/2011 23:56 0
Output file should be of the form
Branch-Id St-Date St-time End-Date End-time Code
CITSK012 30/11/2011 20:00 30/11/2011 20:13 0
CITATKKV 30/11/2011 21:23 30/11/2011 21:44 0
CITIOL## (01-42) 30/11/2011 20:00 1/12/2011 0:11 4
CITBTDLS 30/11/2011 21:33 30/11/2011 21:45 0
CITBTWDS 30/11/2011 23:47 1/12/2011 0:10 4
|
Criteria:
1. Each Branch-Id may have multiple records
2. There is only one group (i.e. jobs from CITIOL01 to CITIOL42) in the sample input file.
3. I need the output as follows:
i) club all the rows with same Branch-Id and apply point 3(ii)
ii) Minimum of St-Date & St-Time and
Maximum of End-Date & End-time,
and then sum or Maximum of Code required for each Branch-Id.
4. For a group ranging from jobs CITIOL01 to CITIOL42, do the similar logic for DATE, TIME and Code, But need only 1 row for all the group. And job name would look like CITIOL##(01-42)
5. I have 5 - 6 of such groups in my production file, If you give for one, I will replicate the syntax for others.
6. CITSK012 have 3 rows in the input file and in the output file, It has only one row, with Minimum of St-Date & St-Time
Maximum of End-Date & End-time
and the sum of Codes
7. Similiary, For Branch-Id, ranging from CITIOL01 to CITIOL42,
Output shows CITIOL##(01-42) and the respective Min, Max Dates and Times.
Please let me know the SYNCSORT logic for this reqq. |
|
Back to top |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello,
Without the code tags am quit sure you are going to make others confuse
Please use the code tags for better understanding. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Yes,
I have the aboe requirement in my project. But I'm not getting any idea to start. Till now, I have used INCLUDE, OMIT, HEADER and TRAILERs only in SORT.
This is something to ahieve big using SORT for me. So I'm looking for a help from experts. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Maybe you need to consider actually writing some code to do this. More so if this is needed quickly.
Not just everything should be done using a sort and/or utility. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi dick,
I used an internal tool, for formatting the data and made it readable and finally, I sit with the above file. Still the major part of sorting out of Dates and Times are there.
I'm not getting any idea of getting it resolved. Need your expertise on this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why "convert" the data from some as yet unposted format to this format that is still a problem to use?
If you want someone here to help, you have to provide the actual data and the output you want from the actual data. This intermediate format may cause you as much problem as it helps.
You also need to clearly explain the rules and show the relationship of a rule to the output data.
As i mentioned before, this may not even be a candidate for a sort solution (even if you get one working).
No matter how this is implemented, there needs to be clear documentation of the process before the implementation is attempted. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Dick,
Please find the actual format of the Source file here along with the copybook.
CITSK012.....cm..Ç....ï....ï...b.{â.
CITSK012...|."...Z.............b.Gâ.
CITSK012.....bMr.Ï....ñ....ñ...b.Ëâ.
CITATKKV.....a.n.+.............b.{â.
CITATKKV...|.@â@.:.............b.Gâ.
CITIOL01.....bMr.Ï....ñ....ñ...b.Ëâ
CITIOL01...|."...Z.............b.Gâ.
CITIOL02...?.Ø...T.............b.Uâ.
CITIOL02..............à....á...b..â.
CITIOL02.....a.n.+.............b.{â.
CITIOL03...|."...Z.............b.Gâ.
CITIOL03.....bMr.Ï....ñ....ñ...b.Ëâ.
CITIOL04...|.@â@.:.............b.Gâ.
CITIOL04...?.Ø...T.............b.Uâ.
CITIOL05..............à....á...b..â.
……….
CITIOL42.....a.n.+.............b.{â.
CITIOL42...|."...Z.............b.Gâ.
CITIOL42.....bMr.Ï....ñ....ñ...b.Ëâ.
CITIOL42..............à....á...b..â.
CITBTDLS...|."...Z.............b.Gâ.
CITBTDLS...|.@â@.:.............b.Gâ.
CITBTWDS...?.Ø...T.............b.Uâ.
CITBTWDS...|.@â@.:.............b.Gâ.
CITBTWDS.....a.n.+.............b.{â.
Branch-id Positions 1-8 CHAR
Filler Positions 9-18 Unsigned Pack
Start-Date Positions 19-21 Unsigned Pack
Start-time Positions 22-23 Unsigned Pack
Endt-Date Positions 24-26 Unsigned Pack
End-time Positions 27-28 Unsigned Pack
Code Positions 29-30 Unsigned Pack
I'm getting this feed from a client machine which we have to use as an input feed and do the necessary validations and formatting and then to send it downstream applicaiton (Web). |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I think that Dick is suggesting that for a complex requirement like this, some code in a programming language will get you the answers you want, if you can engineer the code correctly, rather than spend time trying to hunt down an obscure answer with Sort cards, and then find that your installed version doesn't support what is required, so three days have gone by with no progress to be noted ("investigated the fanciful idea of doing it in a Sort, three days, no solution there" doesn't look so good on a weekly report).
If so, I agree with Dick. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post the sample data using HEX ON and the Code tag.
Why does someone believe any of those numeric fields are unsigned packed? You may intend to treat them all as positive, but they all have a sign. Packed-decimal data by definition has a sign on the mainframe. . .
Also, keep in mind that you know what you are trying to do while no one here has this understanding. |
|
Back to top |
|
|
|