ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Finding Source File in Source Physical File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Finding Source File in Source Physical File

    Hi,


    I'm developing a tool using subfiles in COBOL where I have to show the list of source physical files of a particular library which has the source of the file entered. For eg if there are 3 src-pf in a lib XYZ say.. QLBLSRC, QCLSRC, QDDSSRC and if I search for a source named ABC then it should display the src-pf's which contains this source ABC. Please help.

    Thanks,
    Kamalesh.

  • #2
    Re: Finding Source File in Source Physical File

    Hi kamal_don82:

    See This Thread:
    http://www.code400.com/forum/showthread.php?t=3974&highlight=%22SOURCE+FILE%22

    Then for each source file (as defined above) you will need to
    dspfd file(&lib/&file) type(*mbrlist) output(*outfile) outfile(filelib/filenm) outmbr(*first *add)

    That will get all the source members into the file filelib/filenm

    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

    Comment


    • #3
      Re: Finding Source File in Source Physical File

      Thanks for the help

      Comment


      • #4
        Re: Finding Source File in Source Physical File

        I tried reading the files in Program, for some of the Input Files and Output files 'm getting the file Status 95 at OPEN INPUT and OPEN OUTPUT statements.
        For some files 'm getting File Status 90 also.
        Could some telll me what might be the problem.

        Comment


        • #5
          Re: Finding Source File in Source Physical File

          New question , new thread please.
          ____________________________

          To find out what you're looking for, d/l the Redbook "ILE COBOL Reference Summary" from here and read the section titled "File Status Key Values and Meanings", chapter 11.
          Philippe

          Comment


          • #6
            Re: Finding Source File in Source Physical File

            I have some similar problem. What i want to do is to find the source library for an objects,any type of objects e.g pf, lf, pgm, module, sqlrpgle. I tried to use RTVOBJD but somehow i can't get the source lib for obj with TYPE = ILE, ATTRIBUTE = CLLE.

            Any idea how how can i retrieve the source library?

            Comment


            • #7
              Re: Finding Source File in Source Physical File

              Follow these instructions:
              1. Type DSPPGM program_name on the command line, then press <Enter>.
              2. Press <Enter> 2 more times.
              3. On the third page, you will find the module that was generated from your source member. Type a "5" next to the module for you you want to find the source, then press <Enter>.


              On the Display Program Information screen you will find the name of the source library and source physical file where the source was at compile time.
              "Time passes, but sometimes it beats the <crap> out of you as it goes."

              Comment


              • #8
                Re: Finding Source File in Source Physical File

                thanks, i know how to do DSPPGM and all that. unfortunately, i need to automate the process. anyway, i found a solution already. appreciate for all d help. :-)

                Comment


                • #9
                  Re: Finding Source File in Source Physical File

                  Hi all,

                  If we don't have authority to access file QADBXREF in QSYS, but we need to get info from that file, what can I do ?

                  Regards,

                  Comment


                  • #10
                    Re: Finding Source File in Source Physical File

                    time to dig into the APIs.
                    Code:
                    DListRcdFmts      pr                  ExtPgm('QUSLRCD')   
                    d  CUSQualUSName                20a   Const               
                    d  CUSRcdFmt                     8a   Const               
                    d  CUSPFName                    20a   Const               
                    d  OverrideProc                  1a   Const               
                    d  ErrorCode                 32766a   options(*varsize)   
                    
                     * List Fields API Procedure                                 
                    DListFields       pr                  ExtPgm('QUSLFLD')      
                    d  CUSFldUSName                 20a   Const                  
                    d  CUSRcdFmt                     8a   Const                  
                    d  CUSPFName                    20a   Const                  
                    D  PFRcdFmt                     10a   Const                  
                    d  OverrideProc                  1a   Const                  
                    d  ErrorCode                 32766a   options(*varsize)      
                    
                     * List Key Fields (QDBRTVFD retrieve file desc)API Procedure   
                    DListFileDesc     pr                  ExtPgm('QDBRTVFD')        
                    d  OutputData                32766a   Options(*Varsize)         
                    d  OutputDataLen                10i 0 Const                     
                    d  CUSPFNameRet                 20a                             
                    D  PFRcdFmt                      8a   Const                     
                    d  CUSPFName                    20a   Const                     
                    D  RcdFmt                        8a   Const                     
                    d  OverrideProc                  1a   Const                     
                    d  System                       10a   Const                     
                    d  FormatType                   10a   Const                     
                    d  ErrorCode                 32766a   options(*varsize)         
                    
                     * List Members API Procedure                             
                    DListMembers      pr                  ExtPgm('QUSLMBR')   
                    d  CUSMbrUSName                 20a   Const               
                    d  CUSRcdFmt                     8a   Const               
                    d  CUSPFName                    20a   Const               
                    D  Members                      10a   Const               
                    d  OverrideProc                  1a   Const               
                    d  ErrorCode                 32766a   options(*varsize)   
                                                                              
                     * List Database Relations API Procedure                       
                    DListDBR          pr                  ExtPgm('QDBLDBR')        
                    d  CUSDBRUSName                 20a   Const                    
                    d  CUSRcdFmt                     8a   Const                    
                    d  CUSPFName                    20a   Const                    
                    D  Members                      10a   Const                    
                    d  RcdFmt                       10a   Const                    
                    d  ErrorCode                 32766a   options(*varsize)        
                    
                     * List Members Info (QUSRMBRD retrieve member desc)API Procedure 
                    DListMemberInfo   pr                  ExtPgm('QUSRMBRD')          
                    d  OutputData                32766a   Options(*Varsize)           
                    d  OutputDataLen                10i 0 Const                       
                    D  PFRcdFmt                      8a   Const                       
                    d  CUSPFName                    20a   Const                       
                    d  Member                       10a   Const                       
                    d  OverrideProc                  1a   Const                       
                    d  ErrorCode                 32766a   options(*varsize)
                    OR you can use DSP* commands to outfile and process those.
                    I'm not anti-social, I just don't like people -Tommy Holden

                    Comment


                    • #11
                      Re: Finding Source File in Source Physical File

                      Do you have access to SYSTABLES in QSYS2 or SYSIBM libraries?
                      "Time passes, but sometimes it beats the <crap> out of you as it goes."

                      Comment


                      • #12
                        Re: Finding Source File in Source Physical File

                        Originally posted by littlepd View Post
                        Do you have access to SYSTABLES in QSYS2 or SYSIBM libraries?
                        Actually, I do have have access to SYSTABLES in QSYS2, but it only contains records related to PF or LF objects, Is there a file similar to SYSTABLES but contains CBL, CBLLE (etc..) objects?

                        Comment


                        • #13
                          Re: Finding Source File in Source Physical File

                          Hi 400g:

                          There is no existing file of program objects in a library. You can create one yourself as follows:

                          Code:
                          DSPOBJD OBJ(MYLIB/*ALL) OBJTYPE(*PGM) OUTPUT(*OUTFILE) OUTFILE (QTEMP/MYLIBPGMS)
                          The above will create the file mylibpgms in qtemp. It will list the detail of each program within mylib.

                          Best of luck
                          GLS
                          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                          Comment


                          • #14
                            Re: Finding Source File in Source Physical File

                            this is a tool on the index page.




                            jamie
                            All my answers were extracted from the "Big Dummy's Guide to the As400"
                            and I take no responsibility for any of them.

                            www.code400.com

                            Comment


                            • #15
                              Re: Finding Source File in Source Physical File

                              Hi all,

                              GLS400 : I thought there was another way, but DSPOBJD will have to do. Thx.
                              JAMIEF : Thanks for the solution, but unfortunately, I don't have authority on file QADBXREF.

                              Regards

                              Comment

                              Working...
                              X