View previous topic :: View next topic
|
Author |
Message |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
thanks for your reply .Could you please put some example code |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You'll have to "flatten" the PDS first. Process. Reload. |
|
Back to top |
|
|
ezio vin
New User
Joined: 16 Aug 2012 Posts: 44 Location: india
|
|
|
|
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 |
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
ok .i will try.But better can we do this simplest waY!!!!!! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
ezio vin
New User
Joined: 16 Aug 2012 Posts: 44 Location: india
|
|
|
|
Bell,
i just added code for NIC logic.
cmsmoon
you can create rexx macro to easily complete this |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
|