View previous topic :: View next topic
|
Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi,
I'm using below rexx to concatenate my dataset in the data sets currently allocated to ISPPLIB. It runs without any error, but my dataset is still not concatenated. It works fine with SYSPROC, but it's not working with ISPPLIB. Why is that. Is it because of some access related problem?
Code: |
/**************************** REXX *********************************/
/* THIS EXEC ADDS A DATA SET TO THE FRONT OF THE DATA SETS IN THE */
/* ISPPLIB CONCATENATION. */
/* IT FINDS ALL DATA SETS CURRENTLY ALLOCATED TO ISPPLIB, ADDS THE */
/* NEW DATA SET TO THE BEGINNING AND RE-ALLOCATES THE CONCATENATION*/
/* TO ISPPLIB. */
/*******************************************************************/
ADDNAME = 'MY.ISPPLIB'
X = OUTTRAP('NAME.')/*BEGIN TRAPPING LINES OF OUTPUT FROM COMMANDS*/
/* OUTPUT GOES TO VARIABLES BEGINNING WITH 'NAME.'*/
"LISTA ST" /* LIST THE STATUS OF YOUR CURRENTLY ALLOCATIONS */
FOUND = 'NO' /* SET THE FOUND FLAG TO NO */
I = 1 /* SET THE INDEX VARIABLE TO 1 */
/*******************************************************************/
/* LOOP THROUGH THE LINES OF TRAPPED COMMAND OUTPUT TO FIND LINES */
/* 9 CHARACTERS LONG OR LONGER. CHECK THOSE LINES FOR THE WORD */
/* ISPPLIB UNTIL IT IS FOUND OR UNTIL ALL LINES HAVE BEEN CHECKED. */
/* IF ISPPLIB IS FOUND, THE INDEX IS DECREASED ONE AND THE NAME OF */
/* THE FIRST DATA SET CONCATENATED TO ISPPLIB IS STORED IN VARIABLE*/
/* "CONCAT". */
/*******************************************************************/
DO WHILE (FOUND = 'NO') & (I <= NAME.0)
IF LENGTH(NAME.I) >= 9 THEN
IF SUBSTR(NAME.I,3,7) = 'ISPPLIB' THEN
DO
FOUND = 'YES'
I = I - 1
CONCAT = "'"NAME.I"'"
END
ELSE
I = I + 1
ELSE
I = I + 1
END
/*******************************************************************/
/* WHEN ISPPLIB IS FOUND, LOOP THROUGH DATA SETS UNTIL ANOTHER FILE*/
/* NAME IS ENCOUNTERED OR UNTIL ALL LINES ARE PROCESSED. APPEND */
/* DATA SET NAMES TO THE ONE IN VARIABLE "CONCAT". */
/*******************************************************************/
IF FOUND = 'YES' THEN
DO WHILE (I + 3) <= NAME.0
I = I + 3
IF SUBSTR(NAME.I,1,3) = ' ' THEN
DO
I = I - 1
CONCAT = CONCAT",'"NAME.I"'"
END
ELSE
I = NAME.0
END
ELSE NOP
/* ADD THE NEW DATASET TO THE CONCATENATION */
CONCAT = "'"ADDNAME"',"CONCAT""
/* ALLOCATE THE NEW CONCATENATION TO ISPPLIB */
"ALLOC F(ISPPLIB) DA("CONCAT") SHR REUSE" |
Thanks. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Why don't you use LIBDEF ISPPLIB ? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
You have to change the ISPF DD name allocations before starting ISPF. Otherwise, you get a 'file is open' situation and you cannot change the allocation. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi Pedro,
I tried adding "FREE FI(ISPPLIB)" before allocate statement, but it's giving RC=12.
Basically I want to test the panel from ISPF 7.2 (Display Panel) option, rather than running a rexx macro each time.
Code: |
/*REXX*/
"PROFILE NOPREFIX"
"ISPEXEC LIBDEF ISPPLIB DATASET ID('MY.ISPPLIB')"
"ISPEXEC DISPLAY PANEL(TESTP1)" |
|
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
"FREE FI(DDNAMEID)"
"ALLOC FI("DDNAMEID") DA('"DSNAMEID"',"CONCAT") SHR REUSE" |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Repeating:
Quote: |
You have to change the ISPF DD name allocations before starting ISPF. Otherwise, you get a 'file is open' situation and you cannot change the allocation. |
Also, you cannot FREE a file that is open.
Maybe I was not clear. You have to get out of ISPF so that ISPPLIB is not open, then re-allocate the DD name that ISPF will later open. Then get back into ISPF. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
This is done before I start the ISPF session. if they are doing this after ISPF is running then they should do the a LIBDEF. The REXX he modified and is trying to use this for was designed to be used before ISPF was started and has been around for many many years. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
The poster did not state where the exec was being executed, but I gleaned it from this:
Quote: |
It works fine with SYSPROC, but it's not working with ISPPLIB |
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi Mickeydusaor
Yes..this was an existing macro for SYSPROC at my site, which has been there for quite some time.
Hi Pedro
Yes.. I was executing it after logging into ISPF. I realized my mistake.
Anyways, the issue is resolved now. I have been given the access to one of the test dataset which is already allocated to ISPPLIB. So now I can directly test it from 7.2 option.
Thanks. |
|
Back to top |
|
|
|