IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Concatenate my dataset in ISPPLIB


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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

PostPosted: Tue Sep 23, 2014 7:34 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Sep 23, 2014 8:13 pm
Reply with quote

Why don't you use LIBDEF ISPPLIB ?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Sep 23, 2014 9:11 pm
Reply with 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.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 24, 2014 7:24 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Sep 24, 2014 8:09 pm
Reply with quote

"FREE FI(DDNAMEID)"

"ALLOC FI("DDNAMEID") DA('"DSNAMEID"',"CONCAT") SHR REUSE"
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Sep 24, 2014 9:17 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Sep 24, 2014 9:51 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Sep 24, 2014 10:56 pm
Reply with quote

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
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Sep 24, 2014 11:36 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top