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


Correct Option: B

AI Explanation

To answer this question, we need to understand how the SORT query works and how it will affect the input file sequence.

The SORT query provided has two components: SORT FIELDS and SUM FIELDS.

SORT FIELDS = (1,6,CH,A) specifies that the records should be sorted based on the first 6 characters (position 1 to 6) in ascending order.

SUM FIELDS = (7,2,PD) specifies that the values in the 7th and 8th positions should be summed as they are packed decimal numbers (PD).

Let's go through each option to determine the correct output:

Option A) Arun 50 Arun 20 Naveen10 Naveen40 Priya 25 Priya 35 This option does not seem to be sorted correctly according to the SORT query. Additionally, it does not include the summed values. Therefore, option A is incorrect.

Option B) Priya 60 Naveen50 Arun 70 This option correctly sorts the records based on the first 6 characters and includes the summed values. Therefore, option B is a possible correct answer.

Option C) Arun 70 Naveen50 Priya 60 This option does not seem to be sorted correctly based on the SORT query. Additionally, it does not include the summed values. Therefore, option C is incorrect.

Option D) Naveen50 Priya 60 Arun 70 This option does not seem to be sorted correctly based on the SORT query. Additionally, it does not include the summed values. Therefore, option D is incorrect.

Based on the analysis, the correct answer is option B) Priya 60 Naveen50 Arun 70. This option correctly sorts the records and includes the summed values according to the given SORT query.

Find more quizzes: