i just need the first and last record from a sequencial
file?how

Answers were Sorted based on User's Feedback



i just need the first and last record from a sequencial file?how..

Answer / paray2x

The best option is to used File-Aid processing options.

If not,

1. Use SORT FIELDS=COPY, STOPAFT=1 to get the first record.

2. Insert line numbers in the file using SEQNUM fucntion of
SORT. Then, do a SORT FIELDS on this line number in
descending order, save it a temp file.
3. Use SORT FIELDS=COPY, STOPAFT=1 on this temp file to get
the last record.

Is This Answer Correct ?    0 Yes 3 No

i just need the first and last record from a sequencial file?how..

Answer / sneha

USE SKIP(N) To skip number of records
if 10 accounts are there and u want to skip first 7 records
use
//sysin dd*
repro infile(dd1) -
outfile(dd2) -
skip(07) -
count(03)
/*
for 1st and last
//sysin dd*
repro infile(dd1) -
outfile(dd2) -
count(1) -
skip(08) -
count(01)
/*

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More JCL Interview Questions

How to pass the parameter in parm using linkage section ? (syntax)?

0 Answers   Infosys,


What are hierarchy levels in jcl?

0 Answers  


What is 'S0C7' abend?

9 Answers  


how to resolve the soc4 error?

5 Answers   ITC Infotech,


What do you understand by the term notcat 2 – gs?

0 Answers  






Suppose I have Five Steps in PROC In this Case I want to Execute third Step in PROC using Main JCL don't use any COND Explain with Coding Thanks & Regards SHREE

4 Answers   Merrill Lynch,


Suppose I have 5 dataset listed under a single DD name in a catlogued PROC. How can I override one of those 5 dataset (say 3rd dataset)?

5 Answers   Cognizant,


How do you submit JCL via a Cobol program?

2 Answers   Cap Gemini,


What are the kinds of job control statements?

3 Answers  


i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?

2 Answers   IBM,


Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

0 Answers  


wht is the d/f between positional parameter n keyword parameter ?

1 Answers  


Categories