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

How to write the PDS members info into a PS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lakshmi08

New User


Joined: 01 Jul 2010
Posts: 6
Location: delhi

PostPosted: Thu Jul 01, 2010 5:52 pm
Reply with quote

While trying to write the code for listing the members of a PDS, along with the creation date, modification date of all the members using ISPEXEC commands, I have some problem.

Using the below code, I am able to get the list of all the members along with their information like changed date and all, but I am unsure as to how to proceed with writing this output in to a separate PS file.

OUTTRAP will not work here, as it only works for TSO commands. Can anyone make a suggestion as to how to proceed.
Code:

/* REXX */                                       
LMRC = 0                                                               
ADDRESS ISPEXEC                                                         
"LMINIT DATAID(PDD) DATASET('"PDS"')"                                   
"LMOPEN DATAID("PDD")"                                                 
DO WHILE LMRC = 0                                                       
    SAY MEM ZLC4DATE ZLM4DATE ZLMTIME ZLMSEC ZLUSER '.....'             
    X = OUTTRAP(VAR.)                                                   
   ISPEXEC "LMMLIST DATAID("PDD") OPTION(LIST) MEMBER(MEM) STATS(YES)" 
    X = OUTTRAP('OFF')                                                 
   LMRC=RC                                                             
END                                                                 
ADDRESS ISPEXEC "LMMLIST DATAID("PDD") OPTION(FREE)"                   
ADDRESS ISPEXEC "LMCLOSE DATAID("PDD")"                                 
SAY CENTER("*** END ***",80)                                           
TRACE N 
ADDRESS TSO                                   
"EXECIO  *  DISKW OUTDD (FINIS STEM VAR."     
"FREE FI(OUTDD)"                               
EXIT 0
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jul 01, 2010 6:03 pm
Reply with quote

lakshmi08 wrote:
OUTTRAP will not work here, as it only works for TSO commands.


Well, yes, of course, so why even go there.

If you want to stick with using ISPF Services, you can use the LMPUT service for each line of output.

For REXX, you can either use QUEUE to write each line of output to the stack, or use a stem variable, followed by the EXECIO as you've already shown.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 01, 2010 6:09 pm
Reply with quote

Change
Code:
    SAY MEM ZLC4DATE ZLM4DATE ZLMTIME ZLMSEC ZLUSER '.....'

To

    LINEOUT = MEM ZLC4DATE ZLM4DATE ZLMTIME ZLMSEC ZLUSER '.....'
    QUEUE LINEOUT


Change
Code:
"EXECIO  *  DISKW OUTDD (FINIS STEM VAR."

To

"EXECIO" QUEUED() " DISKW OUTDD (FINIS "
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jul 01, 2010 6:22 pm
Reply with quote

A possible enhancement:

Code:

/* REXX */
Address ISPEXEC                                                 
"LMINIT DATAID(pdd) DATASET('"pds"')"                           
"LMINIT DATAID(outf) DATASET('"out"') ENQ(EXCLU)"               
"LMOPEN DATAID("pdd")"                                           
"LMOPEN DATAID("outf") OPTION(OUTPUT)"                           
Do Forever                                                       
  "LMMLIST DATAID("pdd") OPTION(LIST) MEMBER(mem) STATS(YES)"   
  If rc <> 0 Then Leave                                         
  line = mem zlc4date zlm4date zlmtime zlmsec zluser             
  "LMPUT DATAID("outf") MODE(INVAR) DATALOC(line) DATALEN(80)"   
End                                                             
"LMMADD DATAID("outf") MEMBER("outmem")"                         
"LMMLIST DATAID("pdd") OPTION(FREE)"                             
"LMCLOSE DATAID("pdd")"                                         
"LMCLOSE DATAID("outf")"                                         
Exit 0                                                           


which would allow the code to be used in any language that supports ISPF Service calls.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 01, 2010 6:35 pm
Reply with quote

Cheers Kevin, that one has been cribbed for the archive file icon_wink.gif
Back to top
View user's profile Send private message
lakshmi08

New User


Joined: 01 Jul 2010
Posts: 6
Location: delhi

PostPosted: Thu Jul 01, 2010 6:44 pm
Reply with quote

Hi all,

Thanks for the quick replies..
I modified the code with Queue concept, It worked fine.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 01, 2010 7:04 pm
Reply with quote

what about using the LMMLIST SAVE option

as described in
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ispzrs61/3.45?ACTION=MATCHES&REQUEST=lmmlist&TYPE=FUZZY&SHELF=ISPZPM61.bks&DT=20071211172749&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Duplicate several members of/in one l... JCL & VSAM 7
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Compare two files with a key and writ... SYNCSORT 3
Search our Forums:

Back to Top