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

add fields of non-vsam file using sort utility


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Mon Jan 16, 2006 2:17 pm
Reply with quote

help me i want to add fields of non-vsam file using sort utility.
e.g

i/p
1111 aaaa
2222 bbbb
3333 aaaa

it shold give o/p as

1111 aaaa
5555 bbbb

thankx in advance
regards...
manjinder

Title changed from "hello frds" to "add fields of non-vsam file using sort utility" : Priyesh.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon Jan 16, 2006 10:21 pm
Reply with quote

Can you please bit clear on what conditions you are adding the fields

Regards
Jai
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Jan 16, 2006 10:37 pm
Reply with quote

Add in what way? It looks like you're adding the value in the second aaaa key to the value in the first bbbb key. That doesn't tell us anything about the rules you want to use. Do you really mean to add the values for the same key, in which case the output would be:

4444 aaaa
2222 bbbb

You need to tell us the rules you want to use to get from input to output.
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 10:03 am
Reply with quote

i am really sorry i want to add like this
1111 aaaa
2222 bbbb
3333 aaaa

o/p
4444 bbbb
i am really sorry
regards..
manjinder
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 17, 2006 9:12 pm
Reply with quote

Is this a joke? How do you get 4444 for bbbb?

Again, you need to tell us the rules you want to use to get from input to output.
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Wed Jan 18, 2006 10:14 am
Reply with quote

sorry i wanted toadd like 5555 aaaa.
i was wrong please sorry forgive me pls.
regard..
manjinder
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 18, 2006 9:19 pm
Reply with quote

Ok, how do you get 5555 for aaaa? If I add up the values for the two aaaa records, I get 1111+3333 = 4444.

If you want help, you need to state clearly and correctly what it is you're trying to do, and show a clear and correct example of the input records and what you want for output. We've been at this for three days and we still don't know what you want.

Maybe I can guess what you want (or maybe not).

If your input records are:

1111 aaaa
2222 bbbb
3333 aaaa

and you want to sum on the key to get:

4444 aaaa
2222 bbbb

you can use the following DFSORT control statements:

Code:

   SORT FIELDS=(6,4,CH,A)
   OPTION ZDPRINT
   SUM FIELDS=(1,4,ZD)


Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top