Write a program to concert an Indexed file into Sequential
file?



Write a program to concert an Indexed file into Sequential file? ..

Answer / ajay ahuja

Program:

1. Define sequential file of same record size as of Indexed
file. say "WS-SEQ-FILE-RECORD".

2. Open Indexed file in INPUT mode and Sequential file in
output mode.

3. Read Indexed file into "WS-SEQ-FILE-RECORD".

4. Write into Sequential file. Continue Step 3 thru 4 until
end of Indexed file.


JCL:

Use Utility = IDCAMS,
//DD1 DD DSN=INDEXED.FILE.NAME
//DD2 DD DSN=SEQUENTIAL.FILE.NAME
// SYSIN DD *
REPRO INFILE(DD1) OUTFILE(DD2)
/*
//

I Hope this will help you !!!!

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More COBOL Interview Questions

How do u debug a S0C7 abend? (aswered till we get the field which caused that) After knowing the field which caused that how do u know the record which caused that if it is in production env? (dumb) Ok let us assume that we got to know that 100th record caused that and I wanted to skip only 100th record from the file and process from 101th. How to do that in JCL using SORT? (tried with STOPAFT but ended up dumb when he said smthing else is ther)

3 Answers   IBM,


What is SDSF?

3 Answers  


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..

5 Answers   TCS,


a. Can the OPTIONAL clause in COBOL only be coded for input files? b. If it is coded for files opened in OUTPUT, I-O or EXTEND mode, will it give a compilation error? c. If there are no compilation errors and if such files are not coded in the JCL, will the OPEN statement run fine when these files are opened? d. How will a WRITE statement work for the above files?

2 Answers  


What is a SSRANGE and NOSSRANGE?

0 Answers  






what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


which of the following can be used as a check protection symbol a.Z b.S c.* d.+

2 Answers   TCS,


I try to use some column names in my cobol progorm but these column not in db2 table ..when do i get error ..while bind time or runtime?

2 Answers  


how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it

2 Answers  


when iam reading a flat file which has 100 records through cobol program when iam reading 50th records it gets abends .. so when i run the program again it should read from 50th record .where it got abened ? how it is possible

1 Answers   Patni,


How To move a value to an array using move verb?

3 Answers   IBM,


Categories