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

Copy records from selected boundary


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

New User


Joined: 06 Dec 2006
Posts: 4
Location: India

PostPosted: Thu Sep 25, 2008 12:56 pm
Reply with quote

Hi,
The copy should start from record containing a given value in some position and will stop in record when it gets any other given value present in some specific position.

Can anyone have any idea ? icon_confused.gif
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Sep 25, 2008 1:28 pm
Reply with quote

HI,

Kinldy post sample input and output.

Regards
R KARTHIK
Back to top
View user's profile Send private message
subratghose

New User


Joined: 06 Dec 2006
Posts: 4
Location: India

PostPosted: Thu Sep 25, 2008 2:23 pm
Reply with quote

Hi,

Input:
********************
TSO1 P09342A0026680
TSO1 P11299A0026694
0207 A743 *WU*
1603 1120 **WU**
1603 8105 **WU**
1802 NC8 *WU*
1802 NC8 *WU*
********************

Desired Output:
*******************
0207 A743 *WU*
1603 1120 **WU**
1603 8105 **WU**
1802 NC8 *WU*
*******************

Here the starting record has key (01,04,CH,C'0207')
and the end record has key (01,04,CH,C'1802')
Back to top
View user's profile Send private message
subratghose

New User


Joined: 06 Dec 2006
Posts: 4
Location: India

PostPosted: Thu Sep 25, 2008 3:32 pm
Reply with quote

The copy should start from the record containing value '0207' in position 1 to 4 and copy process should stop when it is '1802'.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 25, 2008 5:40 pm
Reply with quote

Hi,

try this
Code:
//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                           
TSO1 P09342A0026680                                       
TSO1 P11299A0026694                                       
0207 A743 *WU*                                             
1603 1120 **WU**                                           
1603 8105 **WU**                                           
1802 NC8 *WU*                                             
1802 NC8 *WU*     
/*                                       
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//T2       DD DSN=&&T2,DISP=(,PASS),SPACE=(CYL,(5,5),RLSE)
//FIRST    DD DSN=&&F,DISP=(,PASS),SPACE=(TRK,(1))         
//LAST     DD DSN=&&L,DISP=(,PASS),SPACE=(TRK,(1))         
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                           
  COPY FROM(IN) USING(CTL1)                               
  SELECT FROM(T1) TO(FIRST) ON(01,04,CH) FIRST USING(CTL2)         
  SELECT FROM(T2) TO(LAST)  ON(01,04,CH) FIRST USING(CTL3)         
  COPY FROM(IN) USING(CTL4)   
/*                                     
//CTL1CNTL DD *                                                     
  INREC OVERLAY=(081:SEQNUM,8,ZD)                                   
  OUTFIL FNAMES=T1,INCLUDE=(1,4,CH,EQ,C'0207')                     
  OUTFIL FNAMES=T2,INCLUDE=(1,4,CH,EQ,C'1802')
/*                     
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=FIRST,BUILD=(C'    STARTREC=',81,8,C',',80:X)
/*     
//CTL3CNTL DD *                                                     
  OUTFIL FNAMES=LAST,BUILD=(C'      ENDREC=',81,8,C' ',80:X)   
/*     
//CTL4CNTL DD *                                                     
  OUTFIL FNAMES=OUT, 
/*                                             
//         DD DSN=&&F,DISP=(OLD,DELETE),VOL=REF=*.FIRST             
//         DD DSN=&&L,DISP=(OLD,DELETE),VOL=REF=*.LAST             




Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 25, 2008 9:47 pm
Reply with quote

Subrat,

You can do this much more easily and efficiently with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
TSO1 P09342A0026680
TSO1 P11299A0026694
0207 A743  *WU*
1603 1120  **WU**
1603 8105  **WU**
1802 NC8   *WU*
1802 NC8   *WU*
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
   OPTION COPY
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'0207'),
      END=(1,4,CH,EQ,C'1802'),PUSH=(81:ID=8))
   OUTFIL INCLUDE=(81,8,ZD,EQ,1),BUILD=(1,80)
/*


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top