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 |
Can an individual step be restricted from using all the jobs allowed cpu time?
How to read records in reverse order in flat file?
What is the maximum length of a single line of jcl?
How can values be passed from the job stream to an executable program?
Please go thru the below points and let me know how to code this. 1. Sort the input dataset for the condition : Starting position is 37,length of the field is 13 based on character and in the ascending order , starting from position 25 length of 12 ,character and in the ascending order. Use a temporary dataset to hold the sorted file. 2. Use the temporary file created in the above step as the input for the next step. The next step is to execute a program and produce an output file. Use the temporary file created in the above as work file 1 and the output of the file to be created in this step work file 2.Also, pass a parameter to the program that is to be executed in this step. The parameter should have the current date in YYYYMMDD format. For the sake of convenience, you can use the below Job Name : Sample1 Input DSN : PCABDT11.CABD.TEST.INPUT Temporary DSN : Sort1 Output DSN : PCABDT11.CABD.TEST.OUTPUT Program Name : SAMPLE Thanks in Advance for your response.
in my jcl have 20 steps step1,step2,.... step20.and i have to execute step1,step2,..and skip the step3 and remaing step4,step5 are execute? i want skip step3 only? what code u can write?
Explain how can return codes be tested before execution of a job step?
How would I code JCL to copy a gdg data set G001v00 and create a gdg Data set G001v01
what is the difference between static call and dynamic call?
In SPACE,what is directory,RLSE
What is JOBLIB ?
Step 1 RC 4 Step 2 Step 3 I want to know the COND parameter which can be coded in step 2 or 3. Step 2 should be executed based on Step 1 RC and Step 3 should not be executed based on step 1's RC