MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting the Recordings by leaving the Header Records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Hariharan78
Beginner


Joined: 01 Dec 2002
Posts: 28
Topics: 8
Location: India

PostPosted: Thu Feb 06, 2003 12:13 pm    Post subject: Sorting the Recordings by leaving the Header Records Reply with quote

Hi all,
I got a new one of sort exercise. Is it possible to sort by omitting the particular record type.
Eg:

1000 Emp Details Value
3001 Emp1 1000
3002 Emp2 1000
3003 Emp3 1000
3004 Emp1 1000
1000 Dept Details value
3001 Dep1 10
3002 Dep2 20
3003 Dep2 20
3004 Dep3 10

I need to sort by Emp1,Emp2,.. by omitting the
"3001 Emp1 1000" and the duplicate record should be added here Dup is Emp1 IIIy it should be done for the Dept details with Dep1,...

I need the O/p as

1000 Emp Details Value
3001 Emp1 2000
3002 Emp2 1000
3003 Emp3 1000
1000 Dept Details value
3001 Dep1 10
3002 Dep2 40
3003 Dep3 10

Is it possible to do it thro DF Sort
_________________
S.Hariharan
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 06, 2003 12:36 pm    Post subject: Reply with quote

Some questions about the input and output you show. Is this the ACTUAL data as it looks, or is it a representation of the data?

Are the values you want to sum really right aligned rather than left aligned? That is, do they really look like this:

Code:

3001 Emp1 2000
3001 Dep1 10


or like this:

Code:

3001 Emp1 2000
3001 Dep1 0010


or some other way. Please be specific as it makes a difference to the solution you need.

Do you want to keep the Emp records and Dep records in their original order or do you want to sort them by that field?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hariharan78
Beginner


Joined: 01 Dec 2002
Posts: 28
Topics: 8
Location: India

PostPosted: Thu Feb 06, 2003 1:19 pm    Post subject: Reply with quote

Hi Frank,
Thanks for ur reply. It is the representation of data. Actual record ahs length 400.
Actullay I am trying to do like this.

1000 Employee Header Record of Dept1
30001 Hari 1000 Dept1
30002 Fran 2000 Dept1
30001 Hari 100 Dept1
...
...
1000 Employee Header Record of Dept2
30001 Hari 1000 Dept2
30002 Fran 2000 Dept2
30003 Fran 100 Dept2
...
...
Here in the Names and Dept are Key
In the Header record we have Dept as Key ad in detail record we have Name and Dept is as key. Header record will always start with 1 and the detail record will always start with 3


I am trying to get o/p as

1000 Employee Header Record of Dept1
30001 Hari 1100 Dept1
30002 Fran 2000 Dept1
..
...
1000 Employee Header Record of Dept2
30001 Hari 1000 Dept2
30002 Fran 2100 Dept2
..
..


Thanks
_________________
S.Hariharan
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Feb 06, 2003 2:10 pm    Post subject: Reply with quote

Hariharan,

You still did not answer frank's question about the alignment. are all the numbers right justified??

for ex: see this record

Code:

30001 Hari 1000 Dept2


and now see this record

Code:

30001 Hari 100 Dept1


now here the value 100 is left justified. so if are are sum sorting on that you will end up with a s0c7, as we would be sum sorting on total of 4 bytes. so you need to clarify us about that.


Thanks

Kolusu


Last edited by kolusu on Thu Feb 06, 2003 2:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 06, 2003 2:10 pm    Post subject: Reply with quote

Please read my post again and answer the REST of my questions about how the numeric values are aligned and whether you want the original order or the sorted order. It would also help if you would give the position, length and format of the fields to be summed.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hariharan78
Beginner


Joined: 01 Dec 2002
Posts: 28
Topics: 8
Location: India

PostPosted: Thu Feb 06, 2003 2:47 pm    Post subject: Reply with quote

Hi Kolsu & Frank,
Thank you. The number is Right Justified.

Now I am able to Sort Acc to Dept and then the name.
But i got Problem while renumering the One.

For Eg


10000 Employee Header Record of Dept1
30001 Hari 1000 Dept1
30002 Hari 2000 Dept1
30003 Fran 1000 Dept1
...
...
10000 Employee Header Record of Dept2
30001 Hari 1000 Dept2
30002 Fran 2000 Dept2
30003 Fran 100 Dept2
...
...



I am getting the O/P as


10000 Employee Header Record of Dept1
30001 Hari 3000 Dept1
30003 Fran 2000 Dept1
...
...
10000 Employee Header Record of Dept2
30001 Hari 1000 Dept2
30002 Fran 2100 Dept2
...
...


But I need the O/P as

10000 Employee Header Record of Dept1
30001 Hari 3000 Dept1
30002 Fran 2000 Dept1
...
...
10000 Employee Header Record of Dept2
30001 Hari 1000 Dept2
30002 Fran 2100 Dept2
...
...

I am not able to renum.

I tried with Seqnum option but it renum as whole.

The header will starts with 1 and detail starts with 3.

Thanks once again kolusu & Frank for ur kind help.

Bye

[/b]
_________________
S.Hariharan
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 06, 2003 4:06 pm    Post subject: Reply with quote

Well, you've lost me. First I thought you were trying to sum the fields with duplicate records. Now you're talking about some kind of renumbering as well.

I don't know which records you're trying to renumber or what the relationship between the summed numbers and the renumbered numbers, but as you discovered, SEQNUM renumbers every record - it can't restart for each group of duplicates or at a particular record.

Perhaps if you showed us more input and output, and explained how you want to sum and renumber, we could help (but perhaps not). But I'm starting to get the impression that an E15 or E35 exit would be the best way to go on this one.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Hariharan78
Beginner


Joined: 01 Dec 2002
Posts: 28
Topics: 8
Location: India

PostPosted: Thu Feb 06, 2003 4:55 pm    Post subject: Reply with quote

Hi,
Frank. Thanks for your kind assistance.

Bye
_________________
S.Hariharan
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group