Hi,

I wrote this REXX long time ago. I don't know if this is what you're looking 
for.

----------

/* REXX */
/* Program S4 */
/* Find Number of files on disk and list them */
/* fn = file name | *
   ft = file type | *
   fm = file mode | *
   fs = Search String */

/* For example 'S4 * exec a call' will search any 'exec' that resides on 'A' 
and will look for string 'call'.
It will exec 'listfile' with the arguments passed, it'll create file $ACTIVTY 
LOG A$. It'll use it to locate
the search string and will write files found on file '$SEACH FOUND A' */

parse arg fn ft fm fs

'erase $ACTIVTY LOG A'
'erase $SEACH FOUND A'
'listfile ' fn ft fm ' (stack'
Do x = 1 To queued()
   Parse Pull temp
  'EXECIO 1 DISKW $ACTIVTY LOG A (STRING' TEMP
End
'EXECIO * DISKR $ACTIVTY LOG A (STEM TEMPFILE. FINIS'
Do x = 1 To TEMPFILE.0
  'makebuf'
   FileName = TEMPFILE.x
   fn = substr(FileName,1,9)
   ft = substr(FileName,10,9)
   fm = substr(FileName,19,1)
   relrec=1
   do i=1 by 1
      'EXECIO * DISKR ' fn ft fm relrec '(LOCATE /'fs'/'
      if rc<>0 then leave        /* end of file */
      parse pull relrec absrec .
      parse pull rec.i
     'EXECIO 1 DISKW $SEACH FOUND A (STRING' File fn ft fm   Line absrec
     'EXECIO 1 DISKW $SEACH FOUND A (STRING' rec.i
      relrec=0
   end
   rec.0=i-1
'dropbuf'
End

________________________________
From: The IBM z/VM Operating System [mailto:[email protected]] On Behalf 
Of Mehta, Nilay
Sent: Wednesday, March 16, 2011 3:58 PM
To: [email protected]
Subject: EXEC language parser

Hi,

I am trying to create inventory list to show all called procedures from an EXEC 
program.

Ideally I require a language parser which parses the syntax but doesn't execute 
the code; instead just identifies various aspects of the program (like called 
procedures, file definitions etc)

REXX has option that causes commands to be traced but not processed.

TRACE !C

However it doesn't work if calls are made to external procedures (like PLI or 
FORTRAN modules etc)

Is there a utility/command which can help me achieve the above?

My system is z/VM 5.2

Thanks.

Example:

Pseudo code:

ABC EXEC
/* */
CALL 'PRDDATE' 'MMDDYY'
ERASE IUDINIT LOG
'EXEC XYZPGM'
WHEN      SELECTION = 2
THEN      DO
          CMPSCHEM
END
'FILEDEF IPPFILE DISK IPPFILE  DAT  A    (LRECL 110    RECFM F'
'FILEDEF ITTFILE DISK ITTFILE  DAT  A    (LRECL 110    RECFM F'
'QCHG'
 IF RC <> 0 THEN DO;
    SIGNAL ERROR;
 END
RETURN;

The utility should return all called programs:
1.PRDDATE & XYZPGM (which are EXEC and may be written in EXEC, EXEC2 or REXX 
language)
2.CMPSCHEM (which is written in assembly language - CMPSCHEM ASSEMBLE)
3.QCHG (which is PL1 program - QCHG PLI)





............................................................................

For further important information about AllianceBernstein please click here
http://www.alliancebernstein.com/disclaimer/email/disclaimer.html





-----------------------------------------
CONFIDENTIALITY NOTE: This email communication and its attachments
contain information that are proprietary and confidential to
EVERTEC, INC., its affiliates or its clients.  They may not be
disclosed, distributed, used, copied or modified in any way without
EVERTEC, Inc.’s authorization. If you are not the intended
recipient of this email, you are not an authorized person.  Please
delete it and notify the sender immediately. EVERTEC, Inc. and its
affiliates do not assume any liability for damages resulting from
emails that have been sent or altered without their consent.
Moreover, EVERTEC, Inc. has taken precautions to safeguard its
email communications, but cannot assure that such is the case and
disclaim any responsibility attributable thereto.

Reply via email to