have in 100 records in a flat file i want to move records
like 1,3,5,7,9,11,.. to Output file1 and
2,4,6,8,10,12,14 .. records moved to Output file2..Pls
Provide real time answer..

Answer Posted / harsha

For ODD records
//JOBNAME
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT DSN,DISP=SHR
//OUT1 DD DSN=OUTPUT DSN1,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//OUT2 DD DSN=OUTPUT DSN2,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,STARTREC=1,SAMPLE=2
/*
//

For EVEN records
OUTFIL FNAMES=OUT2,STARTREC=2,SAMPLE=2

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10610


What are all the divisions of a COBOL program?

663


i need a small 3d program using inline and outline.

1637


Explain about different table spaces.

649


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

2658






Can we redefine the field of x(200) to less than 200?

818


What is the difference between comp and comp-3 usage?

680


Which is not true about evaluate statement

1577


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1588


what are decleratives in cobol?

1827


What are the pertinent COBOL commands?

2623


What is the Purpose of Pointer in the string?

643


Name the sections present in data division.

701


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5063


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1115