Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Read PDS member in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 26

PostPosted: Mon Sep 11, 2006 5:54 pm    Post subject: Read PDS member in REXX
Reply with quote

I want to read a PS file and a member from PDS. Get a string from PS and try to find in a PDS if found write it to new file.

Did rexx to allocate new file, read the file but don't know to allocate PDS with that specific member.

Please foward me a sample code.

Thanks a lot.
Back to top
View user's profile Send private message
References
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3381
Location: Charlotte,NC USA

PostPosted: Mon Sep 11, 2006 6:11 pm    Post subject: Re: Read PDS member in REXX
Reply with quote

In a TSO session, you would use:

ALLOC DD(ddname) DA('pdsname(member)') SHR REUSE
or
ALLOC FI(ddname) DA('pdsname(member)') SHR REUSE

In JCL, it would be:

//ddname DSN=pdsname(member),DISP=SHR

In ISPF, you would use a couple of services:

LMINIT DATAID(did) DATASET(pdsname) ENQ(EXCLU)
LMOPEN DATAID(&did) OPTION(OUTPUT)
LMPUT DATAID(&did) MODE(INVAR) DATALOC(line) DATALEN(80)
LMMADD DATAID(&did) MEMBER(member)
LMFREE DATAID(&did)
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 26

PostPosted: Mon Sep 11, 2006 6:58 pm    Post subject:
Reply with quote

Thanks Superk. It did work.
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 26

PostPosted: Mon Sep 11, 2006 8:53 pm    Post subject:
Reply with quote

I wrote the rexx code to allocate the member and when i try to read it, it gave me
Code:
    Invalid record format for data set allocated to file IND2. RECFM must be fixed
or variable. Spanned records or records with track overflow are not supported.
    EXECIO error while trying to GET or PUT a record.                               


I am reading a file get the member and read load module in load library and see whether that member is part of the load. Since load is having variable file format rexx could not read it.

Please let me know if there is any simple way to do this task.
Thanks.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3381
Location: Charlotte,NC USA

PostPosted: Tue Sep 12, 2006 1:45 am    Post subject: Re: Read PDS member in REXX
Reply with quote

Normally, I believe that the AMBLIST program is usually used to read a LOADLIB member. However, if you want, you can use ISPF services to read the contents of a LOADLIB member:
Code:

"ISPEXEC LMINIT DATAID(did) DATASET(loadlib) ENQ(SHR)"       
"ISPEXEC LMOPEN DATAID("did") OPTION(INPUT)"                     
"ISPEXEC LMMFIND DATAID("did") MEMBER(member)"                   
Do Forever                                                       
  "ISPEXEC LMGET DATAID("did") MODE(INVAR) DATALOC(inrec)",     
    "DATALEN(inlen) MAXLEN(20000)"                               
  retcode = rc                                                   
  Say inrec                                                     
  If retcode <> 0 Then Leave                                     
End                                                             
"ISPEXEC LMFREE DATAID("did")"                                   
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 26

PostPosted: Tue Sep 12, 2006 6:15 pm    Post subject: Re: Read PDS member in REXX
Reply with quote

Superk, thanks for your input. But I dont know how to compare the INREC with rexx string.

My task is to read a PS file get a string(member) and see whether that member is present in the load library of a specific module.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1