How I sort the records in a file and copy the first 10
records to another file
Answers were Sorted based on User's Feedback
Answer / balasukumar
//SORTIN DD DSN=INF1
//SORTOT DD DSN=OTF
//SYSIN DD *
SORT FIELDS = COPY
SKIP=0
STOPAFT=10
/*
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / haleema
Keep first 10 sorted output records.
SUBSET FROM(IN1) TO(OUT1) OUTPUT KEEP FIRST(10)USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(11,5,CH,A)
/*
Do this using ICETOOL job.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / srinivasa yadav
//sysin dd *
sort fields=(starting postion,length,data-type,order)
skip rec=0
stop rec=10
/*
and also we can use file-aid tool. in file-aid
there is an option 3.3
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / girish kumar
just write like this
sysin dd *
sort fields=copy
stop after=10
/*
//
i tryed it's working
| Is This Answer Correct ? | 1 Yes | 1 No |
i have 10 steps in jcl program but i have to exicute only 2,4,6,8th and 10th ?how it's possible?
Why we us SYSTSIN DD with IKJEFT01 (TSO Utility) to execute a COBOL DB2 program? Why can't we use SYSIN DD?
What does the one advantange of using IEBUPDTE?????
What are the basic JCL Statements for a Job?
what if any ,is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.
SORT card to eliminate duplicity.
how to see the latest generation in gdg?
what is the function of spool command?
What is model dataset label(Model DSCB)?
what are the ways of passing data to a cobol program from jcl?
How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.
Can we use two or more SYSPUNCH DD statements in a JCL for multiple unload (SYSREC00 & SYSREC01)..?