View previous topic :: View next topic
|
Author |
Message |
snammi
New User
Joined: 18 Mar 2009 Posts: 11 Location: Bangalore
|
|
|
|
Hi,
I have requirement to count the records in a dataset based on 2 fields. For example:
File format: 35
Code: |
shipid(5)pickupdate(06)trailerno(7)weight(09)filler(3)
record1:
12345
092211(mmddyy)
1265667
2000
filler1
record2:
92348
092211(mmddyy)
1265667
2000
filler2
record3:
52348
092211(mmddyy)
265471
2000
filler3 |
My requirement is I need to know the count of records (shipments) with same trailer number and pick up date. I sorted the file based on those 2 fields.Is there a way to get the count using JCL sort? Please help.
Thanks in Advance!! |
|
Back to top |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello,
Quote: |
I have requirement to count the records in a dataset based on 2 fields. |
What are the fields
Quote: |
My requirement is I need to know the count of records (shipments) with same trailer number and pick up date. I sorted the file based on those 2 fields.Is there a way to get the count using JCL sort? Please help. |
It's a bit confusing for me, are you counting the records based on the set, as given example by you, there are three set of records present in the file, now
which count do you exactly need. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
- You want to know where trailerno is equal to pickupdate?
- How many times trailerno/puckupdate combinaton are equal (ie not just one tralier/pickup)
- For a specific trailerno and pickupdate how many items?
- Something else
Yes, you will be able to do it, in a variety of ways.[/list] |
|
Back to top |
|
|
snammi
New User
Joined: 18 Mar 2009 Posts: 11 Location: Bangalore
|
|
|
|
Thank You for your replies.
I would like to know how many ship-ids have same trailer and pick-up date combination and I would like to place the count (can be added at the end of output record) on the first record of that set. My input file is sorted based on pick-up date and trailer no.
For the example given
there are 2 records with same trailer and pick-up date combination, 3 rd record is of different combination.
My output should be something like this:
Code: |
12345~092211~1265667~2000~filler1~0002
92348~092211~1265667~2000~filler2
52348~092211~265471~ 2000~filler3~0001
|
Note: You can ignore ~ symbol.
last field of the first record should contain the count of the records which have same pick-up date and trailer number combination.
Thanks for all your help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, clear now.
Although you don't need the count on the subsequent records when there is a match, if it makes the solution easier, do you mind having them?
I think you have to work out all the positions and lengths yourself, ignoring tildes/space for them, if necessary. |
|
Back to top |
|
|
snammi
New User
Joined: 18 Mar 2009 Posts: 11 Location: Bangalore
|
|
|
|
Its okay to put the count on the subsequent records. Can you please suggest how we can achieve this? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
using the code tags will keep the formatting
and make easier for the people willing to help to determine the proper record layout |
|
Back to top |
|
|
snammi
New User
Joined: 18 Mar 2009 Posts: 11 Location: Bangalore
|
|
|
|
Hi Bill,
Did you get chance to code the sort card for my requirement. Please share it if you already done?
It would be great if you can come back with a solution as early as possible. I am working on a task which is supposed to be delivered by the end of week.
Thank You! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
It would be great if you can come back with a solution as early as possible. I am working on a task which is supposed to be delivered by the end of week.
|
it would be great if You would not make silly/improper requests
replying/helping on a forum is...
on our own time
free of charge
when and if we feel like
if You/Your organization have time constraints You/Your organization should consider hiring a paid consultant
who for the proper fee will be glad to accomplish what you ask in the most convenient ( for You ) time span |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am working on a task which is supposed to be delivered by the end of week. |
Then you need to get busy and implement. If not with the sort, with some other code of your own.
It is rather inappropriate to ask people to do your work for you - it is something quite below that to introduce project deadlines. . .
d |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Try this...
Code: |
SORT FIELDS=(7,5,CH,A,14,7,CH,A)
OUTREC BUILD=(1,34,35:SEQNUM,4,ZD,RESTART=(7,12)) |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Goodness me, I hope that nothing I had typed lead you to believe I'd do your work for you.
I was clarifying your requirement in the hope that someone with Syncsort documentation would be able to help you out more easily. |
|
Back to top |
|
|
snammi
New User
Joined: 18 Mar 2009 Posts: 11 Location: Bangalore
|
|
|
|
I can't believe that anyone can be so rude. I did not mean that you have to do my entire work. I just posted to see if I can get some help here.. It doesn't necessarily mean that I am just sitting idle and waiting for your replies. I have been working to get a solution through program. I guess people here took me in wrong sense.
Anyway, Thanks for all your help..
kratos86 - Thank You - My requirements were revised so I don't need it any more. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
Quote: |
Hi Bill,
Did you get chance to code the sort card for my requirement. Please share it if you already done?
|
You should know by now snammi that Bill is a real slacker.
I've been waiting for years for him to write a COBOL to JAVA translator that my company desparately needs.
At least I got my money's worth - $0.00.
Hey - I bet you did, too. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
Quote: |
My requirements were revised so I don't need it any more. |
Now you tell me - I just finished it and sent it overnight at my expense. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Phrzby Phil wrote: |
[...]
You should know by now snammi that Bill is a real slacker.
I've been waiting for years for him to write a COBOL to JAVA translator that my company desparately needs.
At least I got my money's worth - $0.00.
Hey - I bet you did, too. |
I finished it for you years ago. When you didn't send money for the postage stamps I assumed the requirement had changed and you didn't need it any more.
Edit: Joking apart, this thread means I definitely loose out on the "nice guy league". OK, not joking apart. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
Oh no - my bad.
We coulda been contendas. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello snammi,
Yes it does appear you gave the wrong impression - we move on
As far as Syncsort documentation - if your organization is licensed to use the product, Syncsort will help you obtain copies of the manuals. |
|
Back to top |
|
|
|