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

Copy PDS excluding empty members


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Thu Nov 05, 2009 9:14 am
Reply with quote

Hi,

how can we copy all the members of a PDS, excluding empty members, to another PDS?

I know using File-Aid it can be done. Is there another facility which can be used to do the same?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Nov 05, 2009 9:14 pm
Reply with quote

If you can depend on ISPF statistics, you can sort a member list by lines and manually select the members to copy. Or you could write a small program that does LMINIT, LMOPEN, LMMLIST loop, STATS(YES), LMCOPY, ...

But be aware that ISPF statistics are only as good as the program that created them and most programs don't create them at all.

You could, however, modify the above to try to read a record and only do the copy if the record can be read. I seem to remember ISPF services doing odd things if you try to mix reading and writing in the same "dataid" but it might work.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Nov 05, 2009 9:53 pm
Reply with quote

you can update ISPF statistics (line count is one) thru ispf option 3.5,
then you can follow MBabu's suggestion; as you access the STATS you can skip the zero line members.
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 Nov 05, 2009 11:46 pm
Reply with quote

This is the process I came up with:

Code:

//STEP0001 EXEC PGM=IEBPTPCH                                     
//SYSPRINT DD   SYSOUT=*                                         
//SYSUT1   DD   DISP=SHR,DSN=THE.PDS
//SYSUT2   DD   DSN=&&T1,DISP=(,PASS),                           
//         UNIT=VIO,SPACE=(CYL,(10,10),RLSE)                     
//SYSIN    DD   *                                                 
  PUNCH TYPORG=PO,STOPAFT=1                                       
/*                                                               
//*                                                               
//STEP0002 EXEC PGM=SORT                                         
//SORTIN   DD   DSN=&&T1,DISP=(OLD,DELETE)                       
//SORTOUT  DD   DSN=&&T2,DISP=(,PASS),                           
//         UNIT=VIO,SPACE=(CYL,(10,10),RLSE),RECFM=FB             
//SYSOUT   DD   SYSOUT=*                                         
//SYSIN    DD   *                                                 
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,                                       
    BEGIN=(2,11,CH,EQ,C'MEMBER NAME'),                           
    PUSH=(81:SEQ=1,83:15,8))     
  OUTFIL INCLUDE=(81,1,CH,EQ,C'2'),                           
    BUILD=(C'  SELECT M=',83,8,80:X)                             
/*                                                               
//*                                                               
//STEP0003 EXEC PGM=IEBCOPY                                       
//PDSI     DD   DISP=SHR,DSN=THE.PDS
//PDSO     DD   DSN=THE.NEW.PDS,                             
//         DISP=(,CATLG,DELETE),UNIT=SYSDA,SPACE=...
//SYSPRINT DD   SYSOUT=*                                         
//SYSIN    DD   *                                                 
  COPY OUTDD=PDSO,INDD=PDSI                                       
/*                                                               
//         DD   DSN=&&T2,DISP=(OLD,DELETE)                       
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Nov 05, 2009 11:59 pm
Reply with quote

SuperK,

one thing about people who have good skill sets:

their finished product looks so easy.
Back to top
View user's profile Send private message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Fri Nov 06, 2009 9:31 am
Reply with quote

That works perfectly superk.

Thanks everyone for your replies.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Nov 06, 2009 10:23 am
Reply with quote

Well. count me among the impressed! I have to study this one. icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Nov 06, 2009 8:32 pm
Reply with quote

icon_eek.gif Me too
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top