View previous topic :: View next topic
|
Author |
Message |
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
My requirement is : I want to open the dataset without actually going through 3.4 utility.
In my previous assingment, I was opening the PROC, which contained many datasets in it. I was just typing &BR on the command line and placing the cursor on the line, the dataset I am looking for and press enter. It will open the dataset on the same screen and I was able to see the contents of the dataset without actually everytime opening another screen and viewing the dataset.
This was really saving the time....The same command I am trying on my recent assingment, but this command is not working?
Do you have any idea, how this can be achieved may be this through REXX or using Macro concept? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi,
Look at the following code.
I invoke this code to view/Browse a member of a particular PDS. You can modify this on your requirement.
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* REXX MACRO */
/* THE BMEM MACRO */
/* TSO BMEM (MEMBER) */
/* SENDS THE USER TO THE VIEW OF 'XXXX.XXX.XXXXX' TO */
/* VIEW THIS PDS */
/* */
TRACE OFF
ADDRESS ISPEXEC
PARSE ARG STR1 STR2
IF STR1 = '' THEN SIGNAL NOPARM
IF STR2 ¬= '' THEN SIGNAL PARM2
UPPER STR1
MEMBER = STR1
"CONTROL ERRORS RETURN"
"VIEW DATASET('XXXX.XXX.XXXXX("MEMBER")') "
IF RC = 16 THEN DO
SAY 'MEMBER PATTERN MAY HAVE NO MATCH'
END
"CONTROL ERRORS CANCEL"
EXIT
NOPARM:
"VIEW DATASET('XXXX.XXX.XXXXX') "
EXIT
PARM2:
EXIT |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Yes, datasets can be opened without using 3.4. Even in my project we open the dataset using a command rather than 3.4. It was created sometime back. I searched and found the code.
Code: |
ADDRESS ISPEXEC 'ISREDIT MACRO'
"SWAT LINEE 'EDIT'" |
LINEE - Command name (similar to &BR in u r case)
EDIT - To open the file in the edit mode
Try coding this and let me know if this works. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Use this code if u dont like using macros.
Code: |
/* rexx */
ARG DSNAME
"ISPEXEC VIEW DATASET('"DSNAME"')"
|
Store this in a member allocated to SYSEXEC or SYSPROC and then use the following TSO command.
TSO <member name> <dataset name> |
|
Back to top |
|
|
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
I suppose you guys have written REXX code, I am new to REXX.
I believe SYSEXEC is the DD name and corresponding to it will have a PDS name SYSC.CTSO.V3R4.SYSEXEC in my system. I got to see this PDS after typing TSO ISRDDN on the command line.
I have created a local PDS and coded what you have written. I am not able to get how to use this code? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
Back to top |
|
|
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
I am getting an error saying : FILE SYSEXEC NOT UNALLOCATED, DATA SET IS OPEN |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Just code both the lines in a PDS member which is allocated to either SYSEXEC or SYSPROC. Then u can use the TSO command mentioned in my previous post to execute from any screen.
1) First get a list of all the datasets allocated to either SYSEXEC or SYSPROC. You can use the LISTALC command
start:option 6 and then
tso listalc status
2) Copy this member into any of the PDS allocated to these libraries.
3) Use the TSO command to execute.
If you want to allocate your PDS to these libraries instead of adding u r member to the already allocated PDS, then this link might help u
http://ibmmainframes.com/viewtopic.php?t=5446 |
|
Back to top |
|
|
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
Aaru you mean to say Whatever code i write into my local PDS member, I should copy this PDS member to the SYSEXEC PDS? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
There are many ways to execute the REXX programs and one such way is to allocate the dataset to the SYSEXEC/SYSPROC libraries. Then the programs can be executed using TSO <execName>
Quote: |
Whatever code i write into my local PDS member, I should copy this PDS member to the SYSEXEC PDS? |
By SYSEXEC PDS what are referring to? As posted before, Use the TSO LISTALC STATUS command to get the list. I did and got the following. I have pasted only one dataset that is allocated to SYSEXEC.
Code: |
SYSPROC KEEP
PBHQ.PRHD.REXX
KEEP |
The above code indicates that the PDS PBHQ.PRHD.REXX is allocated to SYSPROC. Hence u need to copy your member into this PDS so that you can use the TSO command. |
|
Back to top |
|
|
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
Thanks Aaru |
|
Back to top |
|
|
Select-mf
New User
Joined: 11 May 2007 Posts: 42 Location: bangalore
|
|
|
|
Aaru,
I have done with concatenating my personal PDS for REXX code with the SYSEXEC member. I took some time, because I have not given the access to concatenate it to the system library. Now I am able to execute my REXX programs just by typying TSO <member name> on the command line.
But, I tried both of your code to view or edit the dataset, but its not working. For the first code, its showing SWAT is not found. And for the second code, its showing me some error.
Could you or anyone please look into this, or some other code, so that I can try that.
All I wanted is to just place my cursor on the dataset coded in PROC and type the TSO <member name> on the command line and I can view or edit the dataset on the same screen.
Thanks,
Anil. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
I think my DSNB works more like you want. Put this in "personal PDS for REXX " with member name DSNB. To use it when you are in edit on your JCL type "DSNB" on the command line, position your cursor on the line with DSN=... the dataset you want to browse, then hit enter.
Code: |
/* REXX EDITOR MACRO DSNB BY DOUGLAS WILDER OF AIC */
/***************************************************/
/* BROWSES THE DATASET ON THE CURRENT LINE */
/* OR BETWEEN THE "CC" AND "CC" */
/* DSN STARTS AT DSN= OR DSNAME= OR ISC */
/* DSN END AT "," OR SPACE */
/* FOR GDG BASE OR GDG (+1) USES GDG (0) */
/***************************************************/
ADDRESS "ISREDIT" "MACRO NOPROCESS"
ADDRESS "ISREDIT" "PROCESS DEST RANGE C M"
ADDRESS "ISREDIT" "ISREDIT" "(CMD) = RANGE_CMD"
ADDRESS "ISREDIT" "ISREDIT" "(FIRST) = LINENUM .ZFRANGE"
ADDRESS "ISREDIT" "ISREDIT" "(LAST) = LINENUM .ZLRANGE"
ADDRESS "ISREDIT" "ISREDIT" "(DEST) = LINENUM .ZDEST"
IF CMD = " " THEN DO
ADDRESS "ISREDIT" "(ROW,COL) = CURSOR"
ADDRESS "ISREDIT" "(DATALN) = LINE (ROW)"
DSN = GETDSN( DATALN, COL )
IF DSN = "" THEN DO
SAY 'NO DSN FOUND'
END
ELSE DO
DSNOK = CHECKDSN( DSN )
IF DSNOK = 'Y' THEN DO
ADDRESS "ISPEXEC" "BROWSE DATASET('" || DSN || "')"
END
END
END
ELSE DO
CNT = 1
DO CURRLN = FIRST TO LAST
ADDRESS "ISREDIT" "(DATALN) = LINE (CURRLN)"
DSN = GETDSN( DATALN )
IF DSN = "" THEN DO
NOP
END
ELSE DO
DSNOK = CHECKDSN( DSN )
IF DSNOK = 'Y' THEN DO
ADDRESS "ISPEXEC" "BROWSE DATASET('" || DSN || "')"
END
ELSE DO
SAY "----------------------------------------"
END
END
END
END
EXIT
GETDSN: PROCEDURE
ARG LINE, COL
STARTPOS = POS('DSN=',LINE ) + 4
IF STARTPOS = 4 THEN DO
STARTPOS = POS('DSNAME=',LINE ) + 7
IF STARTPOS = 7 THEN DO
STARTPOS = POS('ISC',LINE )
END
END
ENDPOS = POS(',',LINE,STARTPOS)
IF ENDPOS = 0 THEN DO
ENDPOS = POS(' ',LINE,STARTPOS)
END
IF STARTPOS > 0 & ENDPOS > 0 THEN DO
DSN = SUBSTR(LINE,STARTPOS, ENDPOS - STARTPOS)
END
ELSE DO
DSN = ""
END
RETURN DSN
GETDSI:
ARG DSN
DSNOK = 'N'
MSGSTAT = MSG()
STAT = MSG('OFF')
DSNRTN = LISTDSI("'"DSN"'")
CALL MSG MSGSTAT
SELECT
WHEN SYSUSED = 0 THEN DO
SAY DSN " EMPTY LRECL = " SYSLRECL
DSNOK = 'N'
END
WHEN SYSREASON > 1 THEN DO
MSGSTAT = MSG()
STAT = MSG('OFF')
DSN2 = DSN || '(0)'
DSNRTN = LISTDSI("'" || DSN2 || "'")
STAT = MSG(MSGSTAT)
IF SYSUSED = 0 THEN DO
SAY DSN2 "DATASET EMPTY EMPTY LRECL = " SYSLRECL
END
ELSE IF SYSREASON > 1 THEN DO
SAY DSN2 " NOT FOUND*"
END
ELSE DO
SAY DSN2 " FOUND LRECL = " SYSLRECL
END
END
OTHERWISE DO
DSNOK = 'Y'
END
END
RETURN DSNOK
CHECKDSN:
ARG DSN
CALL OUTTRAP "VAR."
LISTDS "'" || DSN || "'"
CALL OUTTRAP "OFF"
IF VAR.0 >= 3,
& SUBSTR(VAR.3,10,3) = 'GDG' THEN DO
SAY DSN ' GDG BASE'
DSNOK = CHECKGDG(DSN, 0)
END
ELSE DO
IF VAR.0 >= 7,
& SUBSTR(VAR.7,1,21) = 'MEMBER NAME NOT FOUND' THEN DO
SAY DSN ' PDS MEMBER NOT FOUND'
DSNOK = 'N'
END
ELSE DO
DSNOK = 'N'
MSGSTAT = MSG()
STAT = MSG('OFF')
CALL OUTTRAP "VAR."
IF SYSDSN("'"DSN"'") = "OK" THEN DO
CALL OUTTRAP "OFF"
CALL MSG MSGSTAT
DSNOK = GETDSI( DSN )
END
ELSE DO
CALL OUTTRAP "OFF"
CALL MSG MSGSTAT
STARTPOS = POS("(",DSN )
ENDPOS = POS(")",DSN,STARTPOS + 1)
IF STARTPOS > 0 & ENDPOS > 0 THEN DO
DSN2 = SUBSTR(DSN,1,STARTPOS - 1 )
GEN = SUBSTR(DSN,STARTPOS+1, ENDPOS - STARTPOS -1 )
IF GEN > 0 THEN DO
SAY DSN2 || " GENERATION " || GEN || " NOT FOUND"
SAY "USING GENERATION (0)"
GEN = 0
END
DSNOK = CHECKGDG(DSN2, GEN)
END
ELSE DO
SAY DSN || " NOT FOUND"
END
END
END
END
RETURN DSNOK
CHECKGDG:
ARG DSN, GEN
DSNOK = 'N'
GEN2 = 0
DSN2 = DSN
CALL OUTTRAP "VAR."
"LISTC LEVEL(" || DSN || ") ALL"
CALL OUTTRAP "OFF"
DO I = VAR.0 TO 1 BY -1
IF SUBSTR(VAR.I,1,7) = "NONVSAM" THEN DO
IF GEN = GEN2 THEN DO
DSN2 = SUBSTR(VAR.I,17)
LEAVE
END
ELSE DO
GEN2 = GEN2 - 1
END
END
END
IF DSN = DSN2 THEN DO
SAY DSN || ' NOT FOUND'
DSNOK = 'N'
END
ELSE DO
SAY "BROWSING " || DSN2
DSNOK = GETDSI( DSN2 )
DSN = DSN2
END
RETURN DSNOK
|
|
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Anil,
Whatever Aaru has posted, SWAT is the program which accepts two parameters, DSN name and the mode it should be opened.
I beleive he has'nt posted the code.
May be you can try Douglas code.
Douglas,
Thanks for sharing the code buddy. |
|
Back to top |
|
|
SCARCEBOYZ
New User
Joined: 16 May 2005 Posts: 32 Location: Millenium Business Park, Mumbai
|
|
|
|
---- I think I am too late in the discussion but it can be easily done by using EPDF command.
Syntax is EPDF 'dataset name'
Type above command on TSO panel and it will work.
Regards,
Vivek Tripathi |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Vivek,
EPDF is shop specific.
Its not TSO command. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
EPDF is not a TSO command, but an ISPF System Command, and is well documented in the fine manual.
O. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Thank You Vivek. I had not heard of EPDF. Is it standard? It works for me. |
|
Back to top |
|
|
kannanakp Currently Banned New User
Joined: 02 Apr 2007 Posts: 3 Location: Chennai
|
|
|
|
Issue EPDF 'dataset name'. The dataset will be opened in EDIT MODE
If you want to open in view mode Issue: EPDF 'dataset name' VIEW.
Similary, for opening in BROWSEmode, type BROWSE at the end.
Hope this helps you. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
EPDF command works fine for both PS and PDS. Thanks for this cool tip. |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Hi,
I tried executing the EPDF with the dataset name, but i encounter an error message as ' Command EPDF not found '.
Got any suggestions ? |
|
Back to top |
|
|
isha rani
New User
Joined: 18 Oct 2007 Posts: 2 Location: noida, india
|
|
|
|
thanks Vivek,
This is the easiest way and is working.
thanks again. |
|
Back to top |
|
|
jmreddymca Warnings : 1 New User
Joined: 14 Oct 2007 Posts: 29 Location: Bangalore
|
|
|
|
Hi
you can do like this go to 3.4 type the DS name like..
X.Y.Z is DS NAME
type RA infront of DS NAME i.e RA X.Y.Z
it will ask some name assume xyz press enter
then go to ispf type cmd lin dslist xyz it will directly come to ds place.
we can say it as nick name for pds |
|
Back to top |
|
|
|