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
 

 

Copying PDS to PDS with some condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Thu Sep 13, 2012 11:54 am    Post subject: Copying PDS to PDS with some condition
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: 1715
Location: UK

PostPosted: Thu Sep 13, 2012 12:00 pm    Post subject:
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: 72
Location: Chennai

PostPosted: Thu Sep 13, 2012 12:04 pm    Post subject: Reply to: Copying PDS to PDS with some condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Sep 13, 2012 12:28 pm    Post subject: Reply to: Copying PDS to PDS with some condition
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    Post subject: Reply to: Copying PDS to PDS with some condition
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: 72
Location: Chennai

PostPosted: Thu Sep 13, 2012 12:54 pm    Post subject: Reply to: Copying PDS to PDS with some condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Sep 13, 2012 1:06 pm    Post subject: Reply to: Copying PDS to PDS with some condition
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    Post subject: Reply to: Copying PDS to PDS with some condition
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Sep 13, 2012 1:54 pm    Post subject: Reply to: Copying PDS to PDS with some condition
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
http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm
No new posts File matching using specific condition mf_karthik DFSORT/ICETOOL 3 Fri Nov 20, 2015 11:04 pm


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