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


Please Help Members By Posting Answers For Below Questions

How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

648


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2723


Which mode is used to operate the sequential file?

669


State the various causes of s0c1, s0c5 and s0c7.

665


In which area will you utilize 88 level items in cobol?

722






If you are current on the owner of a set, what is the difference between obtain next and obtain first?

644


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

5693


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1523


What is the difference between structured cobol programming and object alternativelyiented cobol?

755


What is rmode(24)

680


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

710


What is the difference between a binary search and a sequential search what are the pertinent cobol?

735


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1230


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

720


explain sorting techniques in cobol program?

690