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..
Answers were Sorted based on User's Feedback
Answer / abhijit18in2002
Input file: ABCD.UTIL.SAMP has following records
Order Warehouse Place Date
10012,COMPUTER,INDIA,20090805
10013,COMPUTER,INDIA,20090805
10014,COMPUTER,INDIA,20090805
10015,COMPUTER,INDIA,20090805
10016,COMPUTER,INDIA,20090805
10017,COMPUTER,INDIA,20090805
//COUNTREC JOB ,'COUNT RECORDS',
// MSGCLASS=Q,CLASS=D,
// NOTIFY=&SYSUID
//STEP010 EXEC PGM=SORT,REGION=4096K
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABCD.UTIL.SAMP,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,5,CH,EQ,C'10015')
/*
SORTOUT :- Ouput in SPool
10015,COMPUTER,INDIA,20090805
Is This Answer Correct ? | 12 Yes | 2 No |
Answer / 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 |
Answer / nandigam
your question was not clear,the above two answer was
correct.
if have any doubt again post same question and with example
Is This Answer Correct ? | 3 Yes | 0 No |
can any one give good example for cond 88 level number and for renames pls urgent dudes ?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
What is SDSF?
why we are using set in searchall?
If there are two files one with 100 records and other with 101 records. we have to find out the one record that is the odd man out . What are the steps to do it
If i initialize the 01 level variable in array, will it initialize all the array elements (occurs)?
What are subroutines ? and how do we pass data to the sub routines?
can we use full outer join with cursors declared in cobol program?
What is cobol?
How can I tell if a module is being called DYNAMICALLY or STATICALLY?
Should I use STOP RUN in the sub program??why?