Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using JCL to know the count of sorted records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Using JCL to know the count of sorted records
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Mon Dec 05, 2011 2:49 pm    Post subject: Reply to: Using JCL to know the count of sorted records
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Mon Dec 05, 2011 3:23 pm    Post subject: Reply to: Using JCL to know the count of sorted records
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Dec 05, 2011 5:11 pm    Post subject: Reply to: Using JCL to know the count of sorted records
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Dec 06, 2011 11:05 am    Post subject: Reply to: Using JCL to know the count of sorted records
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

Site Director


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

PostPosted: Tue Dec 06, 2011 11:30 am    Post subject: Reply to: Using JCL to know the count of sorted records
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Dec 06, 2011 2:23 pm    Post subject: Reply to: Using JCL to know the count of sorted records
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    Post subject:
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

Active Member


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

PostPosted: Tue Dec 06, 2011 6:26 pm    Post subject:
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

Active Member


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

PostPosted: Tue Dec 06, 2011 6:27 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Dec 06, 2011 6:39 pm    Post subject:
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

Active Member


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

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

Oh no - my bad.

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

Site Director


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

PostPosted: Wed Dec 07, 2011 10:50 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us