have in 100 records in a file i want to move only matched
records to one output_file1 and nonmathed records are
moved to another output_file2 ... any one can provide
logic code
Answer Posted / ananth
Use Syncsort or Dfsort for this.
//S001 EXEC PGM=SORT
//SORTIN DD DSN=inputfile,DISP=SHR
//SORTOF01 DD DSN=dsn.match,DISP=(NEW,CATLG)
//SORTOF02 DD DSN=dsn.unmatch,DISP=(NEW,CATLG)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
OUTFIL FNAMES=01,INCLUDE=(1,5,CH,EQ,C'A1000')->for match
OUTFIL FNAMES=02,INCLUDE=(1,5,CH,NE,C'A1000')->for nonmatch
/*
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Discuss about changing dataset name in proc.
) how do u code after getting data?
What is amode(24)?
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 difference between Call and a Link?
How many sections are there in data division in COBOL?
What are declaratives and what are their uses in cobol?
For rewrite, why is it mandatory that file needs to be opened?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How do get the result of your program directly on your pc?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
What are the different rules to perform a Search?
what happens if parmparameter passes zero bytes to the program
When is inspect verb is used in cobol?