View previous topic :: View next topic |
Author |
Message |
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Sun Dec 12, 2010 7:22 am Post subject: How to code SORT (join) if one of the input files is empty? |
|
|
HI, everybody. I'm here again.
I need to code a sort (dfsort or syncsort) in which I have 2 input files:
The main file and a file that will contain some updates.
If the update file is not empty I need to join both updating the main file.
If the update file is empty I'll have to write the output file from the main file just the way it is.
My first try was to include a IF/ENDIF to check if the update file is empty (it works) but I would like to code something inside the sort card.
Any help? _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Sun Dec 12, 2010 4:09 pm Post subject: |
|
|
Post some sample inputs for both cases and show the output you want fro these sample inputs. Explain any processing "rules". Mention the dsorg and lrecl of all of the files. _________________ All the best,
di |
|
Back to top |
|
|
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Mon Dec 13, 2010 6:42 am Post subject: |
|
|
In fact, what I need to know is how to check if my sortin file is empty or not. I know I can do that in JCL using IDCAMS, but I wanted to code that in my sort card. _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Tue Dec 14, 2010 8:48 am Post subject: |
|
|
I had seen those posts before. I was wondering if I could do that inside the sort card. _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Dec 14, 2010 11:44 am Post subject: |
|
|
prog_mario wrote: | I had seen those posts before. I was wondering if I could do that inside the sort card. |
Huh? They are indeed sort card statements in that solution. What do you mean by INSIDE the sort card? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Dec 14, 2010 2:15 pm Post subject: |
|
|
Quote: | If the update file is not empty I need to join both updating the main file.
If the update file is empty I'll have to write the output file from the main file just the way it is.
My first try was to include a IF/ENDIF to check if the update file is empty (it works) but I would like to code something inside the sort card. |
I don't use sort much but isn't all these done with join?
prog_mario gave one solution today - http://www.mvsforums.com/helpboards/viewtopic.php?t=11615
If it doesn't help then post your sample input and output.
Edit: Corrected spelling _________________ Regards,
Diba |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Dec 14, 2010 2:19 pm Post subject: |
|
|
Dibakar,
Did you notice OP and Prog_mario are one and the same?
Kolusu |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Dec 14, 2010 2:22 pm Post subject: |
|
|
_________________ Regards,
Diba |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Dec 14, 2010 2:26 pm Post subject: |
|
|
prog_mario,
am confused here, doesn't your other solution work with empty file? _________________ Regards,
Diba |
|
Back to top |
|
|
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Wed Dec 15, 2010 12:19 pm Post subject: |
|
|
Sorry Dibakar, yes it's working but I didn't test it with the second file empty.
Now I did already and works fine.
Thanks a lot.
I think this conclude this post. _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Dec 15, 2010 12:32 pm Post subject: |
|
|
you are welcome _________________ Regards,
Diba |
|
Back to top |
|
|
|
|