×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




yes, it's quite easy... just treat the file QCBLSRC like you would any other
file. To point at the correct member in the file, you would need to use a
file override either executed from within your COBOL program or from a
preceding CL...

Here's a simple COBOL example:
===================================================================
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

    SELECT         F-FILE
    ASSIGN         DATABASE-QCBLSRC
    ORGANIZATION   SEQUENTIAL
    ACCESS         SEQUENTIAL.

DATA DIVISION.
FILE SECTION.

FD  F-FILE
    LABEL RECORDS ARE STANDARD.

01  F-REC-IO.
     COPY DDS-ALL-FORMATS-I     OF QCBLSRC.
WORKING-STORAGE SECTION.
01  SWITCHES.
    05  S-EOF-IND                     PIC  X(01) VALUE "N".
        88  S-EOF                                VALUE "Y".

PROCEDURE DIVISION.
S0000-I-M-F SECTION.

INITIALIZATION.
    OPEN INPUT  F-FILE.

MAINLINE.
    PERFORM UNTIL S-EOF
       READ F-FILE NEXT RECORD
         AT END
           GO TO FINALIZATION
       END-READ
       DISPLAY SRCSEQ, SRCDAT, SRCDTA
    END-PERFORM.
FINALIZATION.
    CLOSE  F-FILE.
    GOBACK.
=================================================
Without an active override, the first member in QCBLSRC will be read... hope
this is helpful...


-----Original Message-----
From: Kelly Cookson [mailto:kc62301@yahoo.com]
Sent: Thursday, March 21, 2002 7:35 AM
To: cobol400-l@midrange.com
Subject: reading source code


Hi.

I would like to try my hand at developing some
programs to analyze COBOL-400 source code. We store
the source code for each COBOL program as a member in
a source physical file.

What would be the best way for me to access the source
code for analysis?  Is there any way to READ a member
in a source physical file?  Is there any way to save a
member as a data physical file (e.g., a flat file with
one line of source code being one record)?

I'd appreciate any ideas.

Thanks,

Kelly Cookson




__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l
or email: COBOL400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.