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
 

 

Copy records from selected boundary

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copy records from selected boundary
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    Post subject: Reply to: Copy records from selected boundary
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    Post subject: Reply to: Copy records from selected boundary
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    Post subject: Reply to: Copy records from selected boundary
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: 1703
Location: Australia

PostPosted: Thu Sep 25, 2008 5:40 pm    Post subject:
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 Moderator


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

PostPosted: Thu Sep 25, 2008 9:47 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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