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 

interview question i faced

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A
View previous topic :: View next topic  
Author Message
cooolguyin
Beginner


Joined: 15 Jun 2005
Posts: 2
Topics: 1

PostPosted: Wed Jun 15, 2005 9:38 am    Post subject: interview question i faced Reply with quote

here is the interview Q i faced in cts

There are two files one with the records in sorted order , no duplicates and other with unsorted order with duplicates..I want the third file which should contain the records that are in both the first and second file but no duplicates.. should not use merge or sort verb!!. and the output file should be in the sorted order!

could you just tell me the logic of this pgm?

Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 15, 2005 9:47 am    Post subject: Reply with quote

cooolguyin,

Step1 : code a sort step for sorting the second file on key fields and remove the dups

Step2 : Now compare file1 and file2 and generate the output.

The logic of comparing and writting to the output files is described here with examples.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Wed Jun 15, 2005 10:32 am    Post subject: Reply with quote

I am not sure if I understand the whole problem correctly in that I don?t know from which file we must create our output FROM. However, assuming that the output would be coming from the 1st file, I think I would approach it this way???.

The pseudo code might be something like this:

Load all of the keys from file 2 into a table

Loop:
Read a record from file 1
Search table of keys
When key found, write record to file 3 from file 1
Go to Loop


Depending on the number of records(keys) in file 2, you might consider performing a table sort once you have loaded your table. Then by modifying your SEARCH, you could gain some efficiencies.

This solution is based upon the idea that you are not supposed to use SORT either internally(in program) or externally (via JCL).

Hope this helps.....
DTF
________
Building


Last edited by dtf on Tue Feb 01, 2011 1:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
cooolguyin
Beginner


Joined: 15 Jun 2005
Posts: 2
Topics: 1

PostPosted: Wed Jun 15, 2005 10:57 am    Post subject: Reply with quote

HI Kolusu,

Thanks for your reply but where to see the example for comparing and writing the output file?


this is the interview question i got

1) I have 2 files.i want fo merge these records and i want to store in a 3rd file.i want to do without Merge utility and Merge verb also.

2) I want to update the records KSDS-VSAM file from the record number 90 to 100.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 15, 2005 10:59 am    Post subject: Reply with quote

cooolguyin,

ooops I forgot to add the link. here it is

http://www.mvsforums.com/helpboards/viewtopic.php?t=11&highlight=match

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 15, 2005 11:23 am    Post subject: Reply with quote

coolguyin,

Stop posting your interview questions as a single topic. Post all your queries in this topic itself. I have deleted your other post.

Answer 1:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.12?DT=20020923143836

Answer: 2

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.10?DT=20020923143836


Before you attend your next interview I suggest that you spend sometime reading the following books

Programming Guide

Language Reference

Hope this helps...

Cheers

kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A 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