Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to write the PDS members info into a PS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to write the PDS members info into a PS
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

Moderator Team Head


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

PostPosted: Thu Jul 01, 2010 6:03 pm    Post subject: Reply to: How to write the PDS members info into a PS
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: 8620
Location: Back in jolly old England

PostPosted: Thu Jul 01, 2010 6:09 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jul 01, 2010 6:22 pm    Post subject: Reply to: How to write the PDS members info into a PS
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: 8620
Location: Back in jolly old England

PostPosted: Thu Jul 01, 2010 6:35 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Thu Jul 01, 2010 7:04 pm    Post subject: Reply to: How to write the PDS members info into a PS
Reply with quote

what about using the LMMLIST SAVE option

as described in
http://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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Historical/statistical details for me... elixir1986 TSO/ISPF 13 Wed Aug 30, 2017 9:02 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us