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
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
Which mode is used to operate the sequential file?
State the various causes of s0c1, s0c5 and s0c7.
In which area will you utilize 88 level items in cobol?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
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.
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What is rmode(24)
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
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?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
explain sorting techniques in cobol program?