IBM Mainframe JCL and SORT Utility

Questions covering IBM mainframe Job Control Language (JCL), DD statements, and the SORT utility including INREC, OUTREC, OUTFIL, SUM FIELDS, and file operations

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which statement(s) is/are true for LRECL

  1. LRECL=0 is valid only for RECFM=F.
  2. LRECL must not exceed BLKSIZE minus 4 for RECFM=V
  3. LRECL can not exceed BLKSIZE when RECFM=VS
  4. LRECL=nnnnnK syntax is valid.
Question 2 Multiple Choice (Single Answer)

Which parameter indicates when MVS is to free the resource(s) allocated to the DD statement.

  1. FREE
  2. RLS
  3. RLSE
  4. None of the above.
Question 3 Multiple Choice (Single Answer)

How does SUM FIELDS = NONE work?

  1. Sum up value in the fields specified in the SORT FIELDS statement and keep it as only one occurence in the o/p
  2. Removes the duplicates for the fields specified in the SORT FIELDS statement and keeps only the 1st occurence of it
  3. Works only for those records in the i/p file where no duplicates for the fields specified in SORT FIELDS statement,
  4. None of the above
Question 4 Multiple Choice (Single Answer)

In the i/p file A contains the records in the following sequence: Arun 20 Naveen40 Priya 35 Naveen10 Priya 25 Arun 50 If the following SORT query runs on file A, how would the o/p file B look like: SORT FIELDS = (1,6,CH,A) SUM FILEDS = (7,2,PD)

  1. Arun 50 Arun 20 Naveen10 Naveen40 Priya 25 Priya 35
  2. Priya 60 Naveen50 Arun 70
  3. Arun 70 Naveen50 Priya 60
  4. Naveen50 Priya 60 Arun 70
Question 5 Multiple Choice (Single Answer)

In what scenario the sequence field contains the value of 'E' in Sort utility?

  1. user modified field to be sort ascending
  2. No specific order specified
  3. Jumbled order
  4. None of the above
Question 6 Multiple Choice (Single Answer)

How does SUM FIELDS = NONE work?

  1. Sum up value in the fields specified in the SORT FIELDS statement and keep it as only one occurence in the o/p
  2. Removes the duplicates for the fields specified in the SORT FIELDS statement and keeps only the 1st occurence of it
  3. Works only for those records in the i/p file where no duplicates for the fields specified in SORT FIELDS statement,
  4. None of the above
Question 7 Multiple Choice (Single Answer)

In the i/p file A contains the records in the following sequence: Arun 20 Naveen40 Priya 35 Naveen10 Priya 25 Arun 50 If the following SORT query runs on file A, how would the o/p file B look like: SORT FIELDS = (1,6,CH,A) SUM FILEDS = (7,2,PD)

  1. Arun 50 Arun 20 Naveen10 Naveen40 Priya 25 Priya 35
  2. Priya 60 Naveen50 Arun 70
  3. Arun 70 Naveen50 Priya 60
  4. Naveen50 Priya 60 Arun 70
Question 8 Multiple Choice (Single Answer)

How should the SORT statement be used to copy only 10 records with the EMP name 'Anil' to the o/p file, where the Emp name is in the 1st 10 chars of the i/p file?

  1. SORT FIELDS = (1,10,CH,A),SKIPREC= 10
  2. SORT FILEDS = (1,10,CH,A),SIZE = 10
  3. Sort FIELDS = (1,10,CH,A),STOPAFT = 10
  4. Sort FIELDS = (1,10,CH,A),EQUALS = 10
Question 9 Multiple Choice (Single Answer)

what are the different types that can be provided in the RECORD Statement?

  1. F (Fixed), V (Variable), D (ISCII/ASCII Variable)
  2. F (Fixed), V (Variable)
  3. No types are specified in the Record Statement
  4. FI (Fixed), VA (Variable)
Question 10 Multiple Choice (Single Answer)

How do we resequence a file through the Sort statement where the file record length is 300 bytes and the sequence number is present in the 1st 5 bytes?

  1. SORT FIELDS=(1,5,ZD,A) OUTREC FIELDS=(1:SEQNUM,5,ZD,6:6,295)
  2. SORT FIELDS=(1,5,BI,A) OUTREC FIELDS=(1:SEQNUM,5,BI,6:6,295)
  3. SORT FIELDS=(1,5,ZD,A) OUTREC FIELDS=(1:RESEQ,5,ZD,6:6,300)
  4. None of the above
Question 11 Multiple Choice (Single Answer)

An i/p file PRODUCTS contains the records in the following sequence with the fields as SEQ #, PRODUCT NAME, PRODUCT CODE: 0001 LUX 1111 0002 PAMOLIVE 2222 0003 LUX INTERNATIONAL 1111 0004 CINTHOL 3333 Which if the following sort statements would COPY only the LUX products to the o/p file?

  1. SORT FIELDS = COPY INCLUDE COND = (24,4,CH,EQ,'1111')
  2. SORT FIELDS = COPY OMIT COND = (24,4,CH,NE,'1111')
  3. SORT FIELDS = COPY INCLUDE COND = (6,3,CH,EQ,'LUX')
  4. All of the above
Question 12 Multiple Choice (Multiple Answers)

How to multiply the VAT factor .12 with the bought product costs (pos 25-30) in the PRODUCT file and copy to the FINAL file? The file length is 215.

  1. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+0.97,TO=ZD,LENGTH=6,31:31,185)
  2. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+97,DIV,+100,TO=ZD,LENGTH=6,31:31,185)
  3. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,DIV,+100,MUL,+97,TO=ZD,LENGTH=6,31:31,185)
  4. All of the above
Question 13 Multiple Choice (Single Answer)

How to copy the eliminated duplicate records into another file wherein the SORT happens on the 1st 3 characters of the file?

  1. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE OUTFILE FNAME = F2
  2. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE,XSUM
  3. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE COPY = F2
  4. None of the above
Question 14 True/False

INREC adds, delectes or reformats fields after the records are sorted or merged.

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

By using _________ statement, data can be sorted in a file between headers and trailers.

  1. DATASORT
  2. SUBSET
  3. both a and b
  4. None of the above
Question 16 Multiple Choice (Multiple Answers)

How to remove the last record from the i/p file?

  1. SUBSET FROM(IN1) TO(OUT1) INPUT REMOVE LAST = 1
  2. SUBSET FROM(IN1) TO(OUT1) INPUT REMOVE LAST(1)
  3. SUBSET FROM(IN1) TO(OUT1) INPUT REMOVE TRAILER
  4. All of the above
Question 17 Multiple Choice (Single Answer)

Find the i/p file records as below: Student A - Max = 100 Min = 60 Student B - Max = 60 Min = 50 Student C - Max = 80 Min = 75 How to format the file to the following o/p data? Student A - Maximum = 100 Minimum = 60 Student B - Maximum = 60 Minimum = 50 Student C - Maximum = 80 Minimum = 75

  1. OPTION COPY INREC FINDREP=(INOUT=(C'Max',C'Maximum',C'Min',C'Minimum')
  2. OPTION COPY INREC FINDREP=(C'Max',C'Maximum',C'Min',C'Minimum')
  3. Both a and b
  4. None of the above
Question 18 Multiple Choice (Single Answer)

What is the statement to create 2 files from 1 particular i/p file on specific conditions?

  1. OUTREC
  2. INREC
  3. OUTFIL
  4. None of the above
Question 19 Multiple Choice (Single Answer)

Which of the following will enhance the efficiency of the jcl?

  1. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = (1,5,CH,A)
  2. SORT FIELDS = (1,5,CH,A) INCLUDE COND = (10,3,CH,EQ,C'YES')
  3. Order doesn't matter
  4. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = COPY
Question 20 Multiple Choice (Single Answer)

What is the function of the STEPLIB DD statement?

  1. Identify a library to be searched for programs named in the EXEC statement
  2. Identify a library containing executable job steps
  3. Override the system step library within a job stream
  4. All of the above