I have two files , file1 is input file it contains
10,20,30,....,records
but i want to display the records in file 2 as reverse order
.how can we do by using jcl& cobol(dont use array)
please any one can tell me the answer

Answers were Sorted based on User's Feedback



I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / abhishek

First open file-1 as:

OPEN INPUT FILE-1 REVERSED

->If REVERSED clause is specified at the time of opening a
particular file, then that file can be read in reverse
direction.

Now we can read file-1 like
READ FILE-1
INTO ws-record
NOT AT END
PERFORM PARA-1
END-READ

PARA-1
WRITE FILE-RECORD
FROM WS-RECORD
END-WRITE

Is This Answer Correct ?    11 Yes 1 No

I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / rajesh

using count statement

Is This Answer Correct ?    3 Yes 1 No

I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / vaneesh

We can sort the input file in descending order usign DFSORT

sort fields=(1,3,CH,D)

then simply read the sorted file in the program and display
it in the spool.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More COBOL Interview Questions

In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?

1 Answers   CSC,


give the examples of strings in cobol

1 Answers   IBM,


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  


1.What is the limit of linkage section?

4 Answers  


copy 100 records without using ibm utilities

3 Answers  






i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1). can redefines clause be used with occurs clause?

4 Answers  


here is my compile and link edit steps in a jcl //COMPILE1 JOB (3CUS,S),'CCDM TEST' //STEPNAME EXEC PGM=IGYCRCTL,PARM='DYNAM,RENT,LIB,OBJECT, // OFFSET,APOST,OPTIMIZE',REGION=4096K //STEPLIB DD DSNAME=PM7351.TEST2.COB,DISP=SHR //SYSIN DD DSNAME=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT2 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT3 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT4 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT5 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT6 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT7 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSPRINT DD SYSOUT=* //SYSLIN DD DSNAME=&&LOAD,DISP=(MOD,PASS),UNIT=SYSDA, // SPACE=(10,(10,10)),DCB=BLKSIZE=400 //LKED EXEC PGM=IEWL,REGION=1024K //SYSPRINT DD SYSOUT=A //SYSLIB DD DSN=PM7351.TEST2.LOADLIB,DISP=SHR // DD DSN=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSLMOD DD DSN=PM7351.TEST2.LOADLIB, // DISP=SHR //SYSUT1 DD UNIT=SYSDA,DCB=BLKSIZE=1024,SPACE=(CYL,(1,1)) //SYSTERM DD SYSOUT=* //SYSLIN DD DSN=&&LOAD,DISP=(OLD,DELETE) //SYSIN DD DUMMY i am getting IEW2013I 0F08 NO MEMBER NAME WAS SPECIFIED. MODULE WAS SAVED USING TEMPNAM1. could any one tell me the resolution for this..?

1 Answers  


wht is the difference between goto and perform stmts

7 Answers   DELL,


in real time what is the suitable exp where in-stream procedure is better then catalog procedure.

1 Answers  


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

0 Answers  


Sending data is aplhabetic size 7 (value 3000), I wantated this value to be stored in database, which is defined as s9(7)v9(2)comp-3.

2 Answers  


Categories