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 do you reference the printer file formats from cobol programs
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
Give some examples of command terminators?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
What are the access modes of START statement?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
Can a Search can be done on a table with or without Index?
Discuss about changing dataset name in proc.
How you can read the file from bottom?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
What are the various section in data division and briefly explain them.
Write some characteristics of cobol as means of business language.
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
How many bytes S(8) comp field occupy and its maximum value?
What is amode(24)?