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

What is comp-1 and comp-2?

754


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

8135


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

663


how do you reference the ksds vsam file formats from cobol programs

646


How do we get current date from system with century in COBOL?

792






How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2716


i want a program using by if, evaluate , string, unstring, perform, occurs?

4035


When is inspect verb is used in cobol?

666


Name some of the examples of COBOl 11?

2672


how do you reference the printer file formats from cobol programs

644


Difference between cobol and cobol-ii?

697


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

704


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1945


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5354


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

632