Sorting the Recordings by leaving the Header Records
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Sorting the Recordings by leaving the Header Records Author: Hariharan78Location: India PostPosted: Thu Feb 06, 2003 12:13 pm
    —
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

#2:  Author: Frank YaegerLocation: San Jose PostPosted: Thu Feb 06, 2003 12:36 pm
    —
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?

#3:  Author: Hariharan78Location: India PostPosted: Thu Feb 06, 2003 1:19 pm
    —
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

#4:  Author: kolusuLocation: San Jose PostPosted: Thu Feb 06, 2003 2:10 pm
    —
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

#5:  Author: Frank YaegerLocation: San Jose PostPosted: Thu Feb 06, 2003 2:10 pm
    —
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.

#6:  Author: Hariharan78Location: India PostPosted: Thu Feb 06, 2003 2:47 pm
    —
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]

#7:  Author: Frank YaegerLocation: San Jose PostPosted: Thu Feb 06, 2003 4:06 pm
    —
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.

#8:  Author: Hariharan78Location: India PostPosted: Thu Feb 06, 2003 4:55 pm
    —
Hi,
Frank. Thanks for your kind assistance.

Bye



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group