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 

How to code SORT (join) if one of the input files is empty?

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


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Sun Dec 12, 2010 7:22 am    Post subject: How to code SORT (join) if one of the input files is empty? Reply with quote

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
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Dec 12, 2010 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Mon Dec 13, 2010 6:42 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Dec 13, 2010 10:10 am    Post subject: Reply with quote

prog_mario,

Please search before posting. Checking for empty file has been discussed many times

http://www.mvsforums.com/helpboards/viewtopic.php?t=5319

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Tue Dec 14, 2010 8:48 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Dec 14, 2010 11:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Dec 14, 2010 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Dec 14, 2010 2:19 pm    Post subject: Reply with quote

Dibakar wrote:

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


Dibakar,

Did you notice OP and Prog_mario are one and the same?

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Dec 14, 2010 2:22 pm    Post subject: Reply with quote

Embarassed
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Dec 14, 2010 2:26 pm    Post subject: Reply with quote

prog_mario,

am confused here, doesn't your other solution work with empty file?
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
prog_mario
Beginner


Joined: 08 Sep 2007
Posts: 86
Topics: 27

PostPosted: Wed Dec 15, 2010 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Wed Dec 15, 2010 12:32 pm    Post subject: Reply with quote

you are welcome
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
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