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 questions

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


Joined: 21 Apr 2004
Posts: 58
Topics: 31
Location: hyderabad

PostPosted: Mon Apr 10, 2006 1:15 am    Post subject: Interview questions Reply with quote

Hi,

Please answer these questions. These are the interview questions.

1. I've a file which contains 1000 records. Now i want to copy first 500 records to an output file through JCL. How can i copy?

2. I've a file which contains NAME, NUMBER, SALARY. Now i want to select the names which starts with 'kiran' and i want to copy those records to FILE1. Likewise i want to select names which starts with 'KUMAR' and i want to copy those records to FILE2. How can i copy using SORT utility?

3. Suppose i'm calling 3 proceedures in my JCL.
For example: ABC
DEF
GHI
Now i want to override the Dataset Names in both ABC and DEF at certain steps. For example, incase of ABC the step name is STEP3,
incase of DEF the step name is STEP4.

Now the question is, "Where should i overrided the in the JCL"?.
Is it after calling all the procedures or after calling ABC do i need to specify
//STEP3.ABC DD DSN=DATASETNAME,DISP=(NEW,CATLG,DELETE)

like wise after calling DEF, do i need to specify
//STEP4.DEF DD DSN=DATASETNAME,DISP=(NEW,CATLG,DELETE)

(OR)

after calling all the procedures, like:
//STEPNAME EXEC ABC
//STEPNAME EXEC DEF
//STEPNAME EXEC GHI
//STEP3.ABC DD DSN=DATASETNAME,DISP=(NEW,CATLG,DELETE)
//STEP4.DEF DD DSN=DATASETNAME,DISP=(NEW,CATLG,DELETE)


4. How can i concatenate GDG's and what utility we need to use?

5. Suppose i've a GDG with 50 versions. Now i want to use all the 50 versions in my JCL. How can i specify this in my JCL?

6. I've 3 steps in my JCL. Now i'm specifying as follows:

STEP1
DDNAME DD DSN=ABC.DEF.GHI( ),
DISP=(NEW,CATLG,DELETE)

STEP2
DDNAME DD DSN=ABC.DEF.GHI( ),
DISP=SHR
//* IN STEP2 I WANT TO USE THE SAME GDG VERSION THAT IS CREATED IN STEP1.

STEP3 DD DSN=ABC.DEF.GHI( ),
DISP=(NEW,CATLG,DELETE)
//*IN STEP3 I WANT TO CREATE A NEW GDG VERSION AGAIN.

Now the questions are:

a) what values do we need to specify in all the dataset names ?


7) How to concatenate VSAM KSDs and what utility do we need to use?

8) Can we used REPRO command for normal datasets?

9) Generally PARM parameter is used to pass the data from JCL to program.
If i pass NUMERIC DATA through PARM parameter, Can i specify INTEGER DATA TYPE in my cobol program? Like
01 GROUP1.
05 TXT-LENGTH PIC S9(4)COMP.
05 TEXT PIC X( ).

Here in the above case can i specify TEXT as
05 TEXT PIC 9( ). ?


Thanks
kiran
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Apr 10, 2006 2:19 am    Post subject: Reply with quote

Kirank,

You must also spend sometime searching for these questions on this board. Tons of queries have already been posted on each of your questions. Anyway here are the answers.

Question 1
Quote:

1. I've a file which contains 1000 records. Now i want to copy first 500 records to an output file through JCL. How can i copy?


Answer
JCL is not a programming language. You need to handle all logic programmatically and use JCL to invoke your program. Copying first 'n' records can be done by any programming language like COBOL, PL/I etc...or by utilities like SORT, FILEAID etc... for a solution on Sort Search for STOPAFT. For more information, check this link.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca10/3.12?

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca10/3.12.2.5?
Question 2
Quote:

2. I've a file which contains NAME, NUMBER, SALARY. Now i want to select the names which starts with 'kiran' and i want to copy those records to FILE1. Likewise i want to select names which starts with 'KUMAR' and i want to copy those records to FILE2. How can i copy using SORT utility?


Answer
Search for INCLUDE COND or Check this link
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/3.7?DT=20050222160456

Question 3
Quote:

3. Suppose i'm calling 3 proceedures in my JCL.
For example: ABC
DEF
GHI
Now i want to override the Dataset Names in both ABC and DEF at certain steps. For example, incase of ABC the step name is STEP3,
incase of DEF the step name is STEP4.

Now the question is, "Where should i overrided the in the JCL"?.


Answer. After Each proc. Your first solution is correct.

Question 4
Quote:

4. How can i concatenate GDG's and what utility we need to use?


Answer
You don't need any special utilities to concatenate GDGs. Just specify the base name alone in the DD Statement without any version numbers. This will concatenate all active generations into one - starting from the oldest version to the latest.

Code:

//whatever DD DSN=your.gdg.base,
//           DISP=SHR


Question 5
Quote:

5. Suppose i've a GDG with 50 versions. Now i want to use all the 50 versions in my JCL. How can i specify this in my JCL?


Answer
See Answer for Question 4.

Question 6
Quote:

6. I've 3 steps in my JCL. Now i'm specifying as follows:

STEP1
DDNAME DD DSN=ABC.DEF.GHI( ),
DISP=(NEW,CATLG,DELETE)

STEP2
DDNAME DD DSN=ABC.DEF.GHI( ),
DISP=SHR
//* IN STEP2 I WANT TO USE THE SAME GDG VERSION THAT IS CREATED IN STEP1.

STEP3 DD DSN=ABC.DEF.GHI( ),
DISP=(NEW,CATLG,DELETE)
//*IN STEP3 I WANT TO CREATE A NEW GDG VERSION AGAIN.

Now the questions are:

a) what values do we need to specify in all the dataset names ?


Answer
GDG Versions are not catalogued until the job ends. So, when you create a version in Step 1 and want to use the same in Step 2, you need to refer it by (+1) itself instead of (0). When you want to Create one more version use (+2).

Code:

STEP1
DDNAME DD DSN=ABC.DEF.GHI(+1),
DISP=(NEW,CATLG,DELETE)

STEP2
DDNAME DD DSN=ABC.DEF.GHI(+1),
DISP=SHR
//* IN STEP2 I WANT TO USE THE SAME GDG VERSION THAT IS CREATED IN STEP1.

STEP3 DD DSN=ABC.DEF.GHI(+2),
DISP=(NEW,CATLG,DELETE)
//*IN STEP3 I WANT TO CREATE A NEW GDG VERSION AGAIN.


Question 7
Quote:

7) How to concatenate VSAM KSDs and what utility do we need to use?


Answer
VSAM files cannot be concatenated.

Question 8
Quote:

8. Can we used REPRO command for normal datasets?


Answer
Well, Why don't you try and see it yourself ??? It doesn't take too long !

Question 9
Quote:

9) Generally PARM parameter is used to pass the data from JCL to program.
If i pass NUMERIC DATA through PARM parameter, Can i specify INTEGER DATA TYPE in my cobol program? Like
01 GROUP1.
05 TXT-LENGTH PIC S9(4)COMP.
05 TEXT PIC X( ).

Here in the above case can i specify TEXT as
05 TEXT PIC 9( ). ?


Answer
Same as Question 8 Wink

Thanks,
Phantom
Back to top
View user's profile Send private message
kirank
Beginner


Joined: 21 Apr 2004
Posts: 58
Topics: 31
Location: hyderabad

PostPosted: Mon Apr 10, 2006 3:21 am    Post subject: Reply with quote

Hello Phantom,

Thank you very much for the quick response.
Back to top
View user's profile Send private message
arshadh
Beginner


Joined: 10 Jan 2007
Posts: 33
Topics: 12

PostPosted: Mon Aug 30, 2010 2:20 am    Post subject: Reply with quote

Hello Phantom,

Reg question 9,

I tried a program and found that we can use numeric/integer data type in the Linkage section, but the maximum size is limited to 9(18 ) .

Pls correct me if I am wrong.

Arshadh.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 11719
Topics: 74
Location: San Jose

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

arshadh,

Please searh before posting.

Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=1855&highlight=extend

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


Joined: 10 Jan 2007
Posts: 33
Topics: 12

PostPosted: Tue Aug 31, 2010 2:03 am    Post subject: Reply with quote

Thanks Kolusu.
Back to top
View user's profile Send private message
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