|
|
| Author |
Message |
ibmmainframe1
New User
Joined: 26 Jul 2005 Posts: 26
|
|
|
|
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 |
|
 |
References
|
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3381 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
ibmmainframe1
New User
Joined: 26 Jul 2005 Posts: 26
|
|
|
|
| Thanks Superk. It did work. |
|
| Back to top |
|
 |
ibmmainframe1
New User
Joined: 26 Jul 2005 Posts: 26
|
|
|
|
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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3381 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
ibmmainframe1
New User
Joined: 26 Jul 2005 Posts: 26
|
|
|
|
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 |
|
 |
|
|