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

I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

1998


Write the code to count the sum of n natural numbers.

695


how to refer the data field?

1793


How do you get the data to code the BMS macro?

1468


What are all the divisions of a COBOL program?

656






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

1513


What is the difference between perform … with test after and perform … with test before?

863


What is a SSRANGE and NOSSRANGE?

804


What is the usage of comp fields in cobol?

645


How do define dynamic array in cobol.

659


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1603


Discuss about changing dataset name in proc.

755


What is the use of intialize verb?

735


Why did you choose to work with ibm mainframe cobol programming?

621


Explain about different table spaces.

639