error message:Data ID 'DATA1' not found



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

error message:Data ID 'DATA1' not found

Postby helen2000 » Fri Feb 04, 2011 11:12 pm

I wrote an ISPF Edit Macro to replace a string for each member in current library, but I always get the error message: "Data ID 'DATA1' not found",
someone can tell me why, this is source code:
/*-REXX*************************/                               
'ISREDIT MACRO (NESTMAC) PROCESS'                               
'ISREDIT (DATA1) = DATAID'                                   
'ISREDIT (CURMEM) = MEMBER'                                 
SAY "CURRENT MEMBER IS CURMEM-----" CURMEM                   
SAY "CURRENT MEMBER IS MEMBER-----" MEMBER                   
SAY "CURRENT LIBRARY IS DATA1-----" DATA1                   
SAY "CURRENT LIBRARY IS DATAID----" DATAID                   
ADDRESS ISPEXEC 'LMOPEN DATAID('DATA1') OPTION(INPUT)'       
SAY "OPEN SUCCESSFUL!"                                       
MEMBER = ' '                                                 
MEMBER1=' www1'                                             
MEMBER2='2'                                                 
LMRC = 0                                                     
STRCMP = 0                                                   
SAY "GO INTO LOOP!!!"                                       
DO WHILE LMRC=0                                             
  ADDRESS ISPEXEC 'LMMLIST DATAID('DATA1') OPTION(LIST), 
  MEMBER(MEMBER) STATS(NO)'               
  LMRC = RC                                               
  SAY "LMRC=" LMRC                                       
  SAY ZERRLM                                             
  IF LMRC = 0 & MEMBER ¬= CURMEM THEN                     
    DO                                                     
      IF COMPARE(SUBSTR(MEMBER,2,1),MEMBER2) = STRCMP THEN   
        DO                                                 
          SAY 'PROCESSING MEMBER:  ' MEMBER               
          PAUSE                                           
          ADDRESS ISPEXEC 'EDIT DATAID('DATA1') MEMBER('MEMBER') 
          MACRO('NESTMAC')'                     
        END                                                 
      END                                                   


this is output when I run in current library
CURRENT MEMBER IS CURMEM----- CURMEM
CURRENT MEMBER IS MEMBER----- MEMBER
CURRENT LIBRARY IS DATA1----- DATA1 
CURRENT LIBRARY IS DATAID---- DATAID
OPEN SUCCESSFUL!                     
GO INTO LOOP!!!                     
LMRC= 10                             
Data ID 'DATA1' not found.           
                                     
                                     
                                     
                                     
                                     
                                     
 ***                                 


helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: error message:Data ID 'DATA1' not found

 

Re: error message:Data ID 'DATA1' not found

Postby MrSpock » Fri Feb 04, 2011 11:40 pm

Whoa! You can't use the LMOPEN Service until you've called the LMINIT Service first, as documented:

The LMOPEN service opens the data set associated with a given data ID so the data set can be either read from, using LMGET, or written to, using LMPUT. The LMINIT service must be completed before LMOPEN can be used.

For each LMOPEN invocation, you should invoke a matching LMCLOSE service.


http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZSG60/CCONTENTS?DT=20070722202444
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: error message:Data ID 'DATA1' not found

Postby MrSpock » Fri Feb 04, 2011 11:46 pm

I also don't get what you're trying to do here. You're already editing a dataset (presumably a PDS), since you're running an ISPF Edit Macro. Then you want to LMINIT and LMOPEN what dataset? The same one you're editing, or a different one altogether? I don't see in your logic where you've indicated that. Then, I guess you want to use LMMLIST for that PDS and, for each member, find some string, and then use the EDIT Service with another Edit Macro?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: error message:Data ID 'DATA1' not found

Postby helen2000 » Sat Feb 05, 2011 12:31 am

thanks for MrSpock's help,
but my code is from the link :
http://publib.boulder.ibm.com/infocente ... edmac3.htm
and last year it works well. don't need LMINIT before LMOPEN,?
another one I confuse: I run it with "WCHY CHY", it works well, but this year it doesn't work with "WCHY CHY", i have to run it with "TSO %WCHY CHY",
I don't know what's happen? (' wchy' is rexx program name and 'chy' is macro name)
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: error message:Data ID 'DATA1' not found

Postby MrSpock » Sat Feb 05, 2011 1:12 am

My bad, I didn't know you could do that, but I just tested it, and that does work.

Let me go back and take a second look ....
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: error message:Data ID 'DATA1' not found

Postby helen2000 » Sat Feb 05, 2011 1:18 am

I post my whole program for your review,
/*-REXX*************************/                               
'ISREDIT MACRO (NESTMAC) PROCESS'                               
'ISREDIT (DATA1) = DATAID'                                   
'ISREDIT (CURMEM) = MEMBER'                                 
SAY "CURRENT MEMBER IS CURMEM-----" CURMEM                   
SAY "CURRENT MEMBER IS MEMBER-----" MEMBER                   
SAY "CURRENT LIBRARY IS DATA1-----" DATA1                   
SAY "CURRENT LIBRARY IS DATAID----" DATAID                   
ADDRESS ISPEXEC 'LMOPEN DATAID('DATA1') OPTION(INPUT)'       
SAY "OPEN SUCCESSFUL!"                                       
MEMBER = ' '                                                 
MEMBER1=' www1'                                             
MEMBER2='2'                                                 
LMRC = 0                                                     
STRCMP = 0                                                   
SAY "GO INTO LOOP!!!"                                       
DO WHILE LMRC=0                                             
  ADDRESS ISPEXEC 'LMMLIST DATAID('DATA1') OPTION(LIST), 
  MEMBER(MEMBER) STATS(NO)'               
  LMRC = RC                                               
  SAY "LMRC=" LMRC                                       
  SAY ZERRLM                                             
  IF LMRC = 0 & MEMBER ¬= CURMEM THEN                     
    DO                                                     
      IF COMPARE(SUBSTR(MEMBER,2,1),MEMBER2) = STRCMP THEN   
        DO                                                 
          SAY 'PROCESSING MEMBER:  ' MEMBER               
          PAUSE                                           
          ADDRESS ISPEXEC 'EDIT DATAID('DATA1') MEMBER('MEMBER') 
          MACRO('NESTMAC')'                     
        END                                                 
      END                                                   
     IF MEMBER = MEMBER1 THEN LMRC=4                     
    END                                                     
 ADDRESS ISPEXEC 'LMMLIST DATAID('DATA1') OPTION(FREE)'   
ADDRESS ISPEXEC 'LMCLOSE DATAID('DATA1')'               
 EXIT 0             
thanks,
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: error message:Data ID 'DATA1' not found

Postby MrSpock » Sat Feb 05, 2011 1:26 am

OK. So, editing a member of a PDS, and entering the command 'WCHY CHY' on the command line, should invoke the macro because of the command:

'ISREDIT MACRO (NESTMAC) PROCESS'

The commands:

'ISREDIT (DATA1) = DATAID'
'ISREDIT (CURMEM) = MEMBER'

should return the value of the data-id into the variable 'data1', so 'data1' should be a value like 'ISRnnnnn', and the value of the currently edited member should be in the variable 'curmem'. The value of 'CHY' that you entered on the command line should be what's stored in the variable 'NESTMAC'.

Maybe you should post a run-time Trace so we can all see what's going wrong?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: error message:Data ID 'DATA1' not found

Postby helen2000 » Sat Feb 05, 2011 1:42 am

from the output as followin:
 CURRENT MEMBER IS CURMEM----- CURMEM   
 CURRENT MEMBER IS MEMBER----- MEMBER   
 CURRENT LIBRARY IS DATA1----- DATA1     
 CURRENT LIBRARY IS DATAID---- DATAID   
 OPEN SUCCESSFUL!                       
 GO INTO LOOP!!!                         
 LMRC= 10                               
 Data ID 'DATA1' not found.             
                                         
                                         
                                         
                                         
                                         
                                         
 ***                                     

we can see: 1: the program stop in the statement 'LMMLIST DATAID('DATA1') OPTION(LIST), becasue the return code is 10. data1 not found
2: current member and library no value.
I don't konw why? maybe the first 3 statments didn't execute corretly?!
by the way, how to get run time trace, thanks,
helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: error message:Data ID 'DATA1' not found

Postby MrSpock » Sat Feb 05, 2011 1:55 am

/* REXX */
TRACE I
...
then the rest of your code ...
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: error message:Data ID 'DATA1' not found

Postby helen2000 » Sat Feb 05, 2011 2:28 am

i POST THE FRONT REAL TIME TRACE: BUTi don't understand the meaning "L", "o", "v", could you figure out? thanks,

 3 *-* 'ISREDIT MACRO (NESTMAC) PROCESS'     
   >L>   "ISREDIT MACRO (NESTMAC) PROCESS"   
   +++ RC(20) +++                             
      4 *-* 'ISREDIT (DATA1) = DATAID'                     
        >L>   "ISREDIT (DATA1) = DATAID"                   
        +++ RC(20) +++                                     
      5 *-* 'ISREDIT (CURMEM) = MEMBER'                   
        >L>   "ISREDIT (CURMEM) = MEMBER"                 
        +++ RC(20) +++                                     
      6 *-* SAY "CURRENT MEMBER IS CURMEM-----" CURMEM     
        >L>   "CURRENT MEMBER IS CURMEM-----"             
        >L>   "CURMEM"                                     
        >O>   "CURRENT MEMBER IS CURMEM----- CURMEM"       
 CURRENT MEMBER IS CURMEM----- CURMEM                     
      7 *-* SAY "CURRENT MEMBER IS MEMBER-----" MEMBER     
        >L>   "CURRENT MEMBER IS MEMBER-----"             
        >L>   "MEMBER"                                     
        >O>   "CURRENT MEMBER IS MEMBER----- MEMBER"       
 CURRENT MEMBER IS MEMBER----- MEMBER                     
      8 *-* SAY "CURRENT LIBRARY IS DATA1-----" DATA1     
        >L>   "CURRENT LIBRARY IS DATA1-----"             
        >L>   "DATA1"                                     
        >O>   "CURRENT LIBRARY IS DATA1----- DATA1"       
 CURRENT LIBRARY IS DATA1----- DATA1                       
      9 *-* SAY "CURRENT LIBRARY IS DATAID----" DATAID     
        >L>   "CURRENT LIBRARY IS DATAID----"             
        >L>   "DATAID"                                                 
        >O>   "CURRENT LIBRARY IS DATAID---- DATAID"                   
 CURRENT LIBRARY IS DATAID---- DATAID                                   
     10 *-* ADDRESS ISPEXEC 'LMOPEN DATAID('DATA1') OPTION(INPUT)'     
        >L>   "LMOPEN DATAID("                                         
        >L>   "DATA1"                                                   
        >O>   "LMOPEN DATAID(DATA1"                                     
        >L>   ") OPTION(INPUT)"                                         
        >O>   "LMOPEN DATAID(DATA1) OPTION(INPUT)"                     
        +++ RC(10) +++                                                 
     11 *-* SAY "OPEN SUCCESSFUL!"                                     
        >L>   "OPEN SUCCESSFUL!"                                       
    14 *-* MEMBER2='2'               
       >L>   "2"                     
    15 *-* LMRC = 0                   
       >L>   "0"                     
    16 *-* STRCMP = 0                 
       >L>   "0"                     
     17 *-* SAY "GO INTO LOOP!!!"                                               
        >L>   "GO INTO LOOP!!!"                                                 
 GO INTO LOOP!!!                                                               
     18 *-* DO WHILE LMRC=0                                                     
        >V>   "0"                                                               
        >L>   "0"                                                               
        >O>   "1"                                                               
     19 *-*  ADDRESS ISPEXEC 'LMMLIST DATAID('DATA1') OPTION(LIST),             
                                                                               
    MEMBER(MEMBER) STATS(NO)'                                                   
        >L>    "LMMLIST DATAID("                                               
        >L>    "DATA1"                                                         
        >O>    "LMMLIST DATAID(DATA1"                                           
        >L>    ") OPTION(LIST),                                                 
                                               MEMBER(MEMBER) STATS(NO)"       
        >O>    "LMMLIST DATAID(DATA1) OPTION(LIST),                             
                                                                   MEMBER(MEMBER
 ) STATS(NO)"                                                                   
        +++ RC(10) +++                                                         
     21 *-*  LMRC = RC                                                         
        >V>    "10"                                                             
     22 *-*  SAY "LMRC=" LMRC                                                   
        >L>    "LMRC="                                                         
        >V>    "10"                                   
        >O>    "LMRC= 10"                             
 LMRC= 10                                             
     23 *-*  SAY ZERRLM                               
        >V>    "Data ID 'DATA1' not found.           
                                                     
                                                     
                                                     
                                                     
                                                     
                                                     
 Data ID 'DATA1' not found.                           
                                                     


helen2000
 
Posts: 80
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post