have in 100 records in a flat file i want to move records
like 1,3,5,7,9,11,.. to Output file1 and
2,4,6,8,10,12,14 .. records moved to Output file2..Pls
Provide real time answer..
Answer Posted / harsha
For ODD records
//JOBNAME
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT DSN,DISP=SHR
//OUT1 DD DSN=OUTPUT DSN1,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//OUT2 DD DSN=OUTPUT DSN2,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,STARTREC=1,SAMPLE=2
/*
//
For EVEN records
OUTFIL FNAMES=OUT2,STARTREC=2,SAMPLE=2
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
How do u write test cases?
What is the difference between comp and comp-3 usage?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
HOw can I get the negative sign while deduct high value from low value
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
A table has two indexes defined. Which one will be used by the SEARCH?
Give some examples of command terminators?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What is the usage of comp fields in cobol?
What are the different types of condition in cobol and write their forms.
What is the difference between perform … with test after and perform … with test before?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?