i have a sequencial file contains multiple records, i want
to extract one row which contains various fields like order
number,date,warehouse,.ect.. in to the another file by
accepting the order number from jcl. how can i do it. pls
help me..

Answer Posted / sowjanya

let say ur input file is like below.
FD input-file.
01 input-record.
05 order-number pic x(5).
05 order-date pic x(10). etc.
the order number passed by the JCl willbe received in cobol
thru linkage section .let say that is LS-ORDER-NUMBER.

code like below in procedure division.
Procedure division.
Read input-file until EOF
at end move 'Y' to EOF.
if order-number = ls-order-number
write out-rec from input-record.

Here the out-rec contains only one record that has order
number equals to the order number received from JCL.

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 a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1420


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

859


How to remove 2 duplicate records and copy only one using job control language?

974


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

629


What are the different rules to perform a Search?

825


what is difference between cobol and cobol/400

22163


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2292


How do define dynamic array in cobol.

867


how can i see junk values in dclgen or in hostvariable of comp ?

2761


What are various search techniques in cobol? Explain.

877


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

972


What is perform what is varying?

920


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

1832


how to access the file from prodution from changeman tool and to submit a file to production

7105


In COBOL programming, what is PERFORM? What is VARYING?

874