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

Describe the EXEC statement, its meaning, syntax and keywords?

2 Answers  


i want to see the jobs in skeleton queue in diff region. (eg. 7 regions are running means , i want to see all the jobs in 7 regions which are in skel queue using 1 command)

1 Answers  


i want to restart frm step 2, previously i coded cond parameter on step2 wht happens at tht time ?

4 Answers   Infosys,


I have a JCL with 10 steps, want to execute first 5 steps only, what are ways of doing it?is it possible to control through JOB card?

10 Answers   iGate,


I found in one of the jcl, gdg version being mentioned as : abc.def.ghi(-0) Can anyone tell me how referring the version as (-0) is different from referring it as (0)

2 Answers  






What will happen if you attempt to restart a job in the middle of a JCL // IF .... // ENDIF?

4 Answers  


How to point my proc to production dataset always though i keep jcllib order=development.dataset? Is it possible?

3 Answers  


Hi, Say I have 10 flat files and I want to copy all these 10 flat files to a GDG versions flat files (I have GDG base: FDWS01.TEST.RESTORE) in one shot. Can we do that in one shot using a JCL. May be by using IEBGENER. It's a bit urgent. So anyone's fast rely would be appreciated.. Thanks in advance.. 10 flat files ----------------------------------- FDWS01.SUB.RESTORE1 FDWS01.SUB.RESTORE2 FDWS01.SUB.RESTORE3 ; ; FDWS01.SUB.RESTORE10 TO GDG versions ----------------------- FDWS01.TEST.RESTORE.G0001V00 FDWS01.TEST.RESTORE.G0002V00 FDWS01.TEST.RESTORE.G0003V00 ; ; FDWS01.TEST.RESTORE.G0010V00

4 Answers  


When should DISP=MOD is used?

6 Answers   TCS,


How to execute step2,step1, step3 if step1,2,3 are in order

8 Answers   CSC,


hi iam learning mainframes,can anybody tell me how to check JCL errors.(after submiting the JCL we have check in spool or is there any other method)

8 Answers  


how can handle the s0c4 abend???

3 Answers  


Categories