|
Shiva. If you are using using ILE COBOL, you can define the array as external in both programs, and simply call the array processing program. It will have access to the array from the calling program. You can do this with data structures and files. I have used this many times to pass what would be a lot of data between two programs, such as file handling, etc. * ---------------------------------------------------------------- * Lib: LibName SrcF: QCblSrc Copy Member Pgm008CBFD * ---------------------------------------------------------------- * This Code is common to all Pgm008CB** modules, and is copied in * to the DATA DIVISION, FILE SECTION for shared (externally * described) files. * * Changes to these FD entries are reflected in all pgms at compile * time. * * ---------------------------------------------------------------- * ---------------------------------------------------------------- FD First-File * ---------------------------------------------------------------- Is external. 01 First-Rec. COPY DDS-ALL-FORMATS IN FILE1PF. Using this code in both programs, ProgramA can open and read the files, and ProgramB can process the records without passing any parms. ProgramC and rewrite the changed records, ProgramD can delete the records from the file. You can do the same thing with data structures in working storage. They don't have to be named the same, but I find it helps in knowing between programs what is being handled where. * ---------------------------------------------------------------- * Lib: LibName Srcf: QCblSrc Copy member: PGM008CBWS * ---------------------------------------------------------------- * This Code is common to all PGM008CB** modules, and is copied in * to Working-Storage section for shared (externally described) * fields. * * Changes to these data definition statements are reflected in * all pgms at compile time. * ---------------------------------------------------------------- 01 FILE-CONTROLLING-FIELDS is external. 05 Changed-Records-Flag PIC X(01). 88 Changed-Records VALUE 'Y'. 88 No-Changed-Records VALUE 'N'. 05 First-File-Flag PIC X(03). 88 End-First-File VALUE 'EFF'. 88 Not-End-First-File VALUE 'NEF'. 88 Good-First-ReWrite VALUE 'GRW'. 88 Good-First-Write VALUE 'GLW'. 88 Good-First-Delete VALUE 'GLD'. 88 Good-First-Read VALUE 'GLR'. 88 Invalid-First-Key VALUE 'ILK'. 88 Delete-First-OK VALUE 'DLO'. 88 Dont-First-Lender VALUE 'DDL'. 01 Status-Group is external. 05 First-File-STS PIC X(01). 88 First-Open VALUE 'O'. 88 First-Closed VALUE 'C' ' ' X'00'. 01 FILE-STATUS Typedef PIC X(02). 88 IO-OK VALUE '00'. 88 EOF VALUE '10'. 88 NO-MOD-SFLRCDS VALUE '12'. 88 IO-ERR VALUE '21' '24' '30' '34' '90' '91' '92' '94' '95' '9A' '9H' '9I' '9K' '9M' '9N' '9P'. 88 Duplicate-Key VALUE '22'. 88 NO-RECORD VALUE '23'. 88 RECORD-LOCKED VALUE '9D'. 01 First-Status type File-Status is external. The above code is a sample of the copy books I use for all modules that share external files, or working storage sections. I simply copy them into my programs at compile time. Hope this helps! Jim Essinger Senior Programmer/Analyst Student Loan Fund of Idaho PO Box 730 Fruitland ID 83619 208-452-4058 At 08:22 PM 8/22/2002 +0530, you wrote: >-- >Hi all > >I'm looking for a sample program that uses call by reference. I have a >array in PGMA that needs to be processed in PGMB. I would like to ignore >calling the program with the array data itself as a parameter. Instead >would like to use a pointer. If any of you have a sample program that >will explain this functionality, it would be of great help. Please help >with a sample program that uses call by reference > >Thanks & Regards >Shiva > > >-- >**************************Disclaimer************************************ > >Information contained in this E-MAIL being proprietary to Wipro Limited is >'privileged' and 'confidential' and intended for use only by the individual > or entity to which it is addressed. You are notified that any use, copying >or dissemination of the information contained in the E-MAIL in any manner >whatsoever is strictly prohibited. > >***************************************************************************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.