Author: shiitiizz
Subject: Browsing member from any PDS
Posted: Wed Mar 08, 2017 1:17 am (GMT 5.5)
Hi All,
I am trying to write a code, which can be used to open/view any member from production libraries. The member entered could reside in PDS for COBOL or JCL or PROC Controlcards Copybooks etc.
Assuming the code am trying to write is named zoom
The user will enter TSO ZOOM MEMNAME
This should search the MEMNAME in all production libraries and when it finds a member, it opens the Member from that PDS
I tried writing in both CLIST and REXX, and codes are as below
CLIST
This code is working fine, except for one issue that a member-name could be same for a JCL and a PROC, in that case, it opens the library listed first
which is PROCLIB. So, if a user wants to see a JCL, which has the same member-name as PROC, the above logic would not work.
To cater this, I did a code in REXX where user has to enter the member-name, code snippet below:
REXX
This code is working fine too, but here the user has to enter the command
TSO ZOOM
and then has to enter the member-name, somewhat like below
Is there a way that the user can enter command in one line like
TSO ZOOM MEMNAME
and the MEMNAME gets stored in a variable which can be used
for below code check; below code check is needed as all JCLs or PROCs will have last 3 letters as BMP
The idea is to enter one line command as TSO ZOOM MEMNAME and
to avoid the logic of SAY MEMNAME and PULL MEMNAME
Sorry if the post is too lengthy.
Thanks in advance.
Subject: Browsing member from any PDS
Posted: Wed Mar 08, 2017 1:17 am (GMT 5.5)
Hi All,
I am trying to write a code, which can be used to open/view any member from production libraries. The member entered could reside in PDS for COBOL or JCL or PROC Controlcards Copybooks etc.
Assuming the code am trying to write is named zoom
The user will enter TSO ZOOM MEMNAME
This should search the MEMNAME in all production libraries and when it finds a member, it opens the Member from that PDS
I tried writing in both CLIST and REXX, and codes are as below
CLIST
Code: |
PROC 1 MEM CONTROL NOLIST NOSYMLIST NOCONLIST NGLOBAL NUMBER SET USRID = &STR(&SYSUID) IF &LENGTH(&STR(&MEM)) >8 THEN DO WRITE MEMBER NAME SHOULD NOT EXCEED 8 CHARS EXIT END SYSCALL SHOW 'PROCLIB(&MEM.)' SYSCALL SHOW 'PRODJCL(&MEM.)' SYSCALL SHOW 'CTLCARDS(&MEM.)' SYSCALL SHOW 'COBOL(&MEM.)' SYSCALL SHOW 'MFS(&MEM.)' SYSCALL SHOW 'CPY(&MEM.)' WRITE MEMBER &MEM NOT FOUND EXIT SHOW: PROC 1 DSN IF &SYSDSN(&DSN) = OK THEN DO ISPEXEC VIEW DATASET(&DSN) EXIT END END |
This code is working fine, except for one issue that a member-name could be same for a JCL and a PROC, in that case, it opens the library listed first
which is PROCLIB. So, if a user wants to see a JCL, which has the same member-name as PROC, the above logic would not work.
To cater this, I did a code in REXX where user has to enter the member-name, code snippet below:
REXX
Code: |
/* REXX */ ADDRESS ISREDIT 'MACRO (MEM)' SAY ENTER MEM PULL MEM I = INDEX(MEM,BMP) IF INDEX(MEM,BMP) = 6 THEN DO SAY ENTER J TO VIEW JCL OR P TO VIEW PROC PULL OPTION IF OPTION = J THEN DO ADDRESS ISPEXEC "VIEW DATASET('PRODJCL("MEM")')" END ELSE DO ADDRESS ISPEXEC "VIEW DATASET('PROCLIB("MEM")')" END END |
This code is working fine too, but here the user has to enter the command
TSO ZOOM
and then has to enter the member-name, somewhat like below
Code: |
TSO ZOOM |
Code: |
ENTER MEM |
Is there a way that the user can enter command in one line like
TSO ZOOM MEMNAME
and the MEMNAME gets stored in a variable which can be used
for below code check; below code check is needed as all JCLs or PROCs will have last 3 letters as BMP
Code: |
I = INDEX(MEM,BMP) IF INDEX(MEM,BMP) = 6 |
The idea is to enter one line command as TSO ZOOM MEMNAME and
to avoid the logic of SAY MEMNAME and PULL MEMNAME
Sorry if the post is too lengthy.
Thanks in advance.