i have 1000 records in input file and i want to sort it and
the first 200 records to be placed in output file. how to
do that??
Answers were Sorted based on User's Feedback
Answer / kavya
Write a sort step to sort the entire file. Write another
sort step with the following sort card
SORT FIELDS=COPY,
STOPAFT=200
END
Is This Answer Correct ? | 19 Yes | 1 No |
Answer / sudeep
sorry kavya is right.I haven't red the first part.sorting
the file completely at first.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / felix
sorry. my previous answer is wrong.
use the following coding in JCL.
First u should sort the file using sort pgm. enter the
sorted file path in input data set.
//SYSIN DD*
REPRO
INDATASET(WRITE THE INPUT PATH)
OUTDATASET(WRITE THE OUTPUT PATH)
COUNT(200)
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / chinmay
//job1 job 65493,jena,class=a prty=9
//step1 exec pgm=sort
//sysprint dd sysout=*
//indd dd dsn=file1.cob, disp= shr
//outdd dd dsn=file2.cob, disp=(new,catlg,delete)
// unit=sysda,space=(cyl,4,2),rlse)
//sysin dd *
sort fields=(2,4,ch,a)
/*
//step2 exec pgm=idcams
//sysprint dd sysout=*
//sysin dd *
repro -
infile(indd)
outfile(outdd)
count(200)
/*
//
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sivakumar sekharannair
Kavya's answer is correct.
i used the following control card
//SYSIN DD *
SORT FIELDS=(1,3,CH,A),
STOPAFT=8
Input file contained the following records
IMSDEVELOPER CSAA
IMSPRODSUPPORTXEROX
IMSTESTER EMDAC
IMSDEVELOPER CSAA
CICPRODSUPPORTXEROX
IMSTESTER EMDAC
The output i got was
CICPRODSUPPORTXEROX
DB2PRODSUPPORTEMDAC
IMSDEVELOPER XEROX
IMSDEVELOPER CSAA
IMSDEVELOPER CSAA
IMSPRODSUPPORTXEROX
IMSTESTER EMDAC
IMSTESTER EMDAC
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sivakumar sekharannair
The input records shown in the above message contained a
few records9total 10 records) also which was misset while
cut/copy
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / satish
hi to all
the example is useful to our requirement,example is i have
some records and i sort it and first 5 records to be placed
in o/p file
//STEP1 EXEC PGM=SORT
//SORTIN DD *
b
c
d
e
f
g
h
i
j
k
l
/*
//OUT DD dsn=output file*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,1,CH,D)
outfil fnames=out,endrec=5
/*
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / msm
//SYSIN DD *
DEBUG ABEND
SORT FIELDS=(8,11,CH,A)
SORT FIELDS=COPY,STOPAFT=200
END
Is This Answer Correct ? | 0 Yes | 0 No |
Explain the function of dd disp parameter?
What is TimeStamp, What is TimeStamp error and What is the Abend Code for TimeStamp Error ?
IN DFSORT sum fields=none is usec to remove duplicates.how to write the duplicates in another dataset?
How to compare 2 files using File-Aid?
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
What are the parameter in the job card wihtout which job won't run........
IIN APITUDE THEY GAVE ONLY 10 QUESTIONS.. THEY ARE SIMPLE ONE FROM NUMBER SERIES,BOATS,TIME & DISTANCE,PROFIT &LOSS,FIND OUT THE NUMBER ? 9 25 4 36 81 64 49 AND surveillance SPELLINGS E.T.C
What is the function of dd name parameter with a 2 part structure; audit.report?
What is a Generation Data Group (GDG)?
in step1 of a jcl,disp=(mod,delete,delete) step02 exec pgm=ccc,cond=(0,le) will step02 be executed? i)never ii)always iii) iv)... i dont remember options
What is NOTCAT ?
What do you understand by the term job time – out and how can you overcome that?