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

Copying PDS to PDS with some condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Thu Sep 13, 2012 11:54 am
Reply with quote

Hi Friends,

I would like to copy all memers one PDS to another PDS ,But omit records from 4 to 48 for all members.Can any one help me , how to do this.Normally we are using OMIT in Sort .But OMIT is used to filter inside the records.Can we omit records using record number?

and

is there any TSO commends to delete from 4 to 48 records (line 4 to 48) using line number?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Sep 13, 2012 12:00 pm
Reply with quote

As you read the member into sort add a sequence number to the end. As you copy them out omit those with a sequence number >= 4 and <=48 dropping the sequence off as you write
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Thu Sep 13, 2012 12:04 pm
Reply with quote

thanks for your reply .Could you please put some example code
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 13, 2012 12:28 pm
Reply with quote

You'll have to "flatten" the PDS first. Process. Reload.
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Thu Sep 13, 2012 12:29 pm
Reply with quote

Code:
//************************************************************       
//S030     EXEC PGM=ICETOOL                                         
//************************************************************       
//TOOLMSG  DD  SYSOUT=*                                             
//DFSMSG   DD  SYSOUT=*                                             
//SORTIN1  DD  DSN=XXX.XXXX.XXXXXXXX.XXX.XXXXX.XXXXX, *71 RECORDS   
//             DISP=SHR                                             
//SORTOUT1 DD DSN=&&TEMP,SPACE=(CYL,(300,300)),DISP=(MOD,KEEP,DELETE)
//SORTOUT2 DD  DSN=XXX.XXXX.XXXXXXXX.XXX.XXXXX.XXXXXX, *26 RECORDS   
//             DISP=(NEW,CATLG,DELETE),                             
//             SPACE=(CYL,(10,20),RLSE),                             
//             UNIT=DISK                                             
//TOOLIN   DD    *                                                   
     COPY FROM(SORTIN1) TO(SORTOUT1) USING(SRT1)                     
     COPY FROM(SORTOUT1) TO(SORTOUT2) USING(SRT2)                   
//SRT1CNTL DD     *                                                 
    SORT FIELDS=COPY                                                 
    INREC FIELDS=(1,150,SEQNUM,8,ZD)                                 
/*                                                                 
//SRT2CNTL DD     *                                               
    SORT FIELDS=COPY                                               
    OMIT COND=(151,8,CH,GE,C'00000004',OR,151,8,CH,LE,C'00000048')
    OUTREC FIELDS=(1,150)
/*                                                                 


try this icon_biggrin.gif
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Thu Sep 13, 2012 12:54 pm
Reply with quote

ok .i will try.But better can we do this simplest waY!!!!!!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 13, 2012 1:06 pm
Reply with quote

ezio vin,

Thanks for the keenness, but you are passing the data twice and not even dealing with the requirement that the input is a PDS for which the same processing has to be done for all members.

cmsmoon,

The simplest way is to sit down in front of your screen and work away at it.

Find out how to unload a PDS into a sequential file that you can read normally. Find out how to load the data back into a PDS. Two utilities. Samples abound. Dropping the data will be simple enough.
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Thu Sep 13, 2012 1:36 pm
Reply with quote

Bell,

i just added code for NIC logic. icon_exclaim.gif icon_exclaim.gif

cmsmoon

you can create rexx macro to easily complete this
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Sep 13, 2012 1:54 pm
Reply with quote

why not simply use the SUBSET FUNCTION OF ICETOOL

SUBSET FROM(<input>) TO(<output>) DISCARD RRN(4,48)

for a PDS You would have to run as many steps as the members

faster to use an edit macro to
obtain the list of members and edit each one to delete the unwanted lines

see
www.ibmmainframes.com/viewtopic.php?t=25947&highlight=

You will have to simply code the inner macro to delete the extra lines
( not so difficult )
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 13, 2012 11:18 pm
Reply with quote

cmsmoon,

Allocate a PDS just like your PDS that you want to copy and use file manager to copy the pds with skipping the records. Use the following JCL

Code:

//STEP0100 EXEC PGM=FILEMGR                 
//SYSOUT   DD SYSOUT=*                     
//SYSPRINT DD SYSOUT=*                     
//SYSIN    DD *                             
$$FILEM SET HEADERPG=YES,PAD=OFF,NOTRUNC=NO
$$FILEM DSC DSNIN=Your input PDS name,         
$$FILEM MEMBER=*,                           
$$FILEM PACK=ASIS,                         
$$FILEM POSITION=0,                         
$$FILEM SMPLINCL=3,                         
$$FILEM SMPLSKIP=45,                       
$$FILEM STATS=FORCE,                       
$$FILEM REPLACE=YES,                       
$$FILEM RECCOUNTS=YES,                     
$$FILEM DISP=OLD,                           
$$FILEM DSNOUT=Your output PDS name
//*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts Copying GDG version(all/few) from pro... CLIST & REXX 13
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
Search our Forums:

Back to Top