Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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: 8593
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: 4648
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: 8593
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: 10256
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 Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am
No new posts Need info with DBRC recovery ashek15 IMS DB/DC 0 Mon Jan 23, 2017 6:43 am
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us