Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
Posted: Fri Jul 21, 2017 12:04 pm Post subject:
Suchay,
You need to be clear on what you want. Make sure you describe ALL of your requirements at once instead of adding one requirement at a time. You need to learn to use the code tags properly. you need to use "/" aka backward slash for the ending code. You have been using forward slash "/" which does not work. Here is a link to the topic that shows how to use the code tags.
Now coming to your control cards. Why did you have 134, 18 when the city name is ONLY 14 bytes? Did you add another field in the WHEN=GROUP ? Or is that a typo? or you just wanted 4 spaces after the city name as your Amount field starts at 152? Why are using UFF format when you wanted signs? You need to use SFF format which handles the SIGN also.
Either way considering these are all typos, here are optimized control cards which will give you the desired results
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
Posted: Fri Jul 21, 2017 2:29 pm Post subject:
Magesh_J wrote:
Kolusu,
how about two steps solution and avoid sorting ?
Limitation :
city appears only once in the report i.e no duplicate city.
Thanks
Magesh
Magesh,
OP hasn't confirmed about the cities being unique. So If OP has unique city names then he can use a copy. However if you look at my new control cards, I actually reduced the file length to just 39 bytes instead of the fill length of 133. So resources required to sort is reduced and it takes care even if OP had duplicate data. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
OP hasn't confirmed about the cities being unique. So If OP has unique city names then he can use a copy. However if you look at my new control cards, I actually reduced the file length to just 39 bytes instead of the fill length of 133. So resources required to sort is reduced and it takes care even if OP had duplicate data.
Kolusu,
Now OP confimred its unique.
You are converting the value twice + SORT + 5 BUILD statments
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
Posted: Fri Jul 21, 2017 3:11 pm Post subject:
Suchay wrote:
Magesh/Kolusu,
Cities are unique, since it is a summary for each City the report produces
Kolusu,
On the requirements part , it is an adhoc request and client keeps changing since onetime run. will follow the code tag standards going forward
Well you could have answered the question about cities being earlier itself before the left justified request and yet you did not bother to answer that simple detail. . You could have saved a lot of time.
Either way if your cities are unique, then use the following control cards which will give you the desired results in a single pass
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
Posted: Fri Jul 21, 2017 3:25 pm Post subject:
Magesh_J wrote:
kolusu wrote:
OP hasn't confirmed about the cities being unique. So If OP has unique city names then he can use a copy. However if you look at my new control cards, I actually reduced the file length to just 39 bytes instead of the fill length of 133. So resources required to sort is reduced and it takes care even if OP had duplicate data.
Kolusu,
Now OP confimred its unique.
You are converting the value twice + SORT + 5 BUILD statments
Please advise which would be optimal ?
Thanks
Magesh
Magesh,
If the cities are unique, then why even bother with 2 steps? It can be done in a single pass of data as shown above. Obviously a COPY operation is efficient than a SORT operation. Please remember that there are many ways to arrive at a solution.
Had I known that the cities are unique, I would have arrived at that solution to begin with. So it all depends on how detailed the question is. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
Posted: Fri Jul 21, 2017 3:45 pm Post subject:
Magesh_J wrote:
Kolusu,
Did you use any robo to develope code ?
How could you derive an alternate solution @ this speed ?
Regards,
Magesh
huh? Robot that can think and write the solutions? wow. No I do not have access to any of those AI based robots. I wish I had one though.
It is just me who codes the solutions. If you give the detailed requirement, I can code most of the job even in my sleep. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
All times are GMT - 5 Hours Goto page Previous1, 2
Page 2 of 2
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