IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using JCL to know the count of sorted records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
snammi

New User


Joined: 18 Mar 2009
Posts: 11
Location: Bangalore

PostPosted: Mon Dec 05, 2011 1:08 pm
Reply with quote

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
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Mon Dec 05, 2011 2:22 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Dec 05, 2011 2:49 pm
Reply with quote


  1. You want to know where trailerno is equal to pickupdate?
  2. How many times trailerno/puckupdate combinaton are equal (ie not just one tralier/pickup)
  3. For a specific trailerno and pickupdate how many items?
  4. Something else


Yes, you will be able to do it, in a variety of ways.[/list]
Back to top
View user's profile Send private message
snammi

New User


Joined: 18 Mar 2009
Posts: 11
Location: Bangalore

PostPosted: Mon Dec 05, 2011 3:12 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Dec 05, 2011 3:23 pm
Reply with quote

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
View user's profile Send private message
snammi

New User


Joined: 18 Mar 2009
Posts: 11
Location: Bangalore

PostPosted: Mon Dec 05, 2011 3:57 pm
Reply with quote

Its okay to put the count on the subsequent records. Can you please suggest how we can achieve this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon Dec 05, 2011 5:11 pm
Reply with quote

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
View user's profile Send private message
snammi

New User


Joined: 18 Mar 2009
Posts: 11
Location: Bangalore

PostPosted: Tue Dec 06, 2011 10:34 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Dec 06, 2011 11:05 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Dec 06, 2011 11:30 am
Reply with quote

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. . . icon_sad.gif

d
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Dec 06, 2011 12:20 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Dec 06, 2011 2:23 pm
Reply with quote

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
View user's profile Send private message
snammi

New User


Joined: 18 Mar 2009
Posts: 11
Location: Bangalore

PostPosted: Tue Dec 06, 2011 5:55 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Tue Dec 06, 2011 6:26 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Tue Dec 06, 2011 6:27 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Dec 06, 2011 6:39 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Tue Dec 06, 2011 6:41 pm
Reply with quote

Oh no - my bad.

We coulda been contendas.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Dec 07, 2011 10:50 am
Reply with quote

Hello snammi,

Yes it does appear you gave the wrong impression - we move on icon_cool.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts CA7 count with DATE variable CA Products 0
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
No new posts ICETOOL returns no records JCL & VSAM 1
Search our Forums:

Back to Top