There are a set of 10 files and a customer will be
selecting random no of files(i.e they may be more than 2,
may not be in the order).Sometimes he might just select
one file or sometimes no files at all.How do you code a JCL
for this? Is it possible to code just JCL alone for this
problem?

Answer Posted / yogendra shinde

Hi,
I don't know the exact answer to this query.
But I have following approach.

Suppose I have a cobol pgm (say) PGM123 that is picking up
files randomly. (We definately need 1 application pgm to
process any of those 10 files randomly. This is my basic
assumption)
I will code a PARM or SYSIN DD * where in my customer can
change order of selection of files .

Say if customer enters PARM as ABCD in order then I will
move this PARM ABCD in a working storage variable in COBOL
PGM and will read each byte A (assign to process file-1)
if second byte is B then process file-2 of third byte is C
then process file-3 and so on. If the cutomer changes this
parm as EDA then files processed will be file-5 then file-4
then file-1.

If any body has different approach pls let me know.

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is the record format of an output dataset specified?

754


Explain the function of //cntl statement?

666


Which statement is used to identify the private libraries in job?

688


which utility is used to run a cobol-db2 program?

820


whats the diff bw the evaluate also and and?

1870






how JCL works?

806


which utility is used a dummy utility?

809


I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.

1740


how can you check if a file is empty using jcl?

825


How can a jobs execution priority be modified?

807


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

870


Are there any set of rules for the names of the steps used in a job?

647


how do you access an uncataloged dataset in a jcl?

877


Name what parameter directs the output of the job log dataset?

570


What is the difference between the positional and keyword parameters? Give examples.

726