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

Interview quetions asked in Polaris


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rameshchandra

New User


Joined: 23 Nov 2005
Posts: 6
Location: pune

PostPosted: Sat Oct 03, 2009 3:12 pm
Reply with quote

Hi,
here i have listedout the quetions which are asked in my polaris interview. could you please helpme out to solve these.

1)there is one input file and one database is there.we need to create a output file that contains the records which are present in Database and not present in inputfile.please anyone help me for Logic,

2)How do we retrieve odd numbered records like 1st,3rd,5th,7th... from a file.

Thanks
Ramesh chandra
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Oct 03, 2009 5:55 pm
Reply with quote

rameshchandra wrote:


1)there is one input file and one database is there.we need to create a output file that contains the records which are present in Database and not present in inputfile.please anyone help me for Logic,

2)How do we retrieve odd numbered records like 1st,3rd,5th,7th... from a file.


1)step1: create a temp table which contains the records in your input file,
step2: issue the following SQL statement:
Code:
SELECT * FROM TB1 WHERE xx NOT EXIST (SELECT * FROM TEMPLE)


2)method 1: you can use SORT tool.
method 2: You can compose the following loop logic embeded into your program:
Code:

read file;
counter=counter+1;
if (counter/2)
then  process;
else continue with the next file reading processing.

Back to top
View user's profile Send private message
rameshchandra

New User


Joined: 23 Nov 2005
Posts: 6
Location: pune

PostPosted: Sat Oct 03, 2009 7:47 pm
Reply with quote

Hi Dejunzhu,
Thank you very much for the answers.

Thanks
Rameshchandra
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 05, 2009 8:57 am
Reply with quote

Quote:
1)there is one input file and one database is there.we need to create a output file that contains the records which are present in Database and not present in inputfile.please anyone help me for Logic,

You can go with solution provided by dejunzhu or
other could be, unload the table to ps and then use utility like DFSORT to find records only in second file i.e. unloaded file


Rameshchandra wrote:
2)How do we retrieve odd numbered records like 1st,3rd,5th,7th... from a file.

Here is sample code using DFSORT
Code:

//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//DFSMSG   DD SYSOUT=*               
//SORTIN DD DSN=your input dataset
//OUT1 DD DSN=your output dataset
//OUT2 DD DUMMY                       
//SYSIN DD *                         
  SORT FIELDS=COPY                   
  OUTFIL FNAMES=(OUT1,OUT2),SPLIT     
/*                                   
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 05, 2009 9:14 am
Reply with quote

For second this is better one
Code:

//SYSIN DD *                             
  SORT FIELDS=COPY                       
  OUTFIL FNAMES=(OUT1),SAMPLE=2         
/*                                       
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts The Last Two Question For You To Ask ... Mainframe Interview Questions 0
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
No new posts Where can i find Interview questions ... Mainframe Interview Questions 4
Search our Forums:


Back to Top