| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| psmadhusudhan Beginner
 
  
 Joined: 28 Nov 2006
 Posts: 143
 Topics: 48
 
 
 | 
			
				|  Posted: Wed Apr 28, 2010 5:21 am    Post subject: Copy Every 3rd record using IEBPTPCH |   |  
				| 
 |  
				| I tried copying every 3rd record of sequential file but it not working . I used the solution listed here 
 http://www.mvsforums.com/helpboards/viewtopic.php?p=11075#11075
 
 
 Following is my input file with record length of 211:
 
 
  	  | Code: |  	  | A18112845641              STGECO    63236VF63236VF40           DJDE  FORMA
 CSTGECO              C63236VF845641              181140           DJDE  FORMA
 CSTGECO              C63236VF845641              181140           DJDE  FORMA
 A18112845641              STGECO    63236VF63236VF40          1
 CSTGECO              C63236VF845641              181140          1
 CSTGECO              C63236VF845641              181140          1
 A18112845641              STGECO    63236VF63236VF40          0        BR/
 CSTGECO              C63236VF845641              181140          0        BR/
 CSTGECO              C63236VF845641              181140          0        BR/
 A18112845641              STGECO    63236VF63236VF40        <    -
 CSTGECO              C63236VF845641              181140        <    -
 CSTGECO              C63236VF845641              181140        <    -
 A18112845641              STGECO    63236VF63236VF40        *    -
 CSTGECO              C63236VF845641              181140        *    -
 CSTGECO              C63236VF845641              181140        *    -
 A18112845641              STGECO    63236VF63236VF40        %    -
 CSTGECO              C63236VF845641              181140        %    -
 CSTGECO              C63236VF845641              181140        %    -
 | 
 There is data still on right side
 
 I used following JCL:
 
  	  | Code: |  	  | //COPY3RD  JOB TAX,'COPY EVERY 3RD',CLASS=P,MSGCLASS=T,NOTIFY=&SYSUID
 //STEP0100 EXEC PGM=IEBPTPCH
 //SYSPRINT DD  SYSOUT=*
 //SYSUT1   DD  DSNAME=TATS.DB10H01.ATS1811.ILLOC.PRTFILE.G2564V00,
 //             DISP=SHR
 //SYSUT2   DD  SYSOUT=*
 //SYSIN    DD  *
 PUNCH TYPORG=PS,SKIP=3
 /*
 | 
 
 I got following output
 
  	  | Code: |  	  | V CSTGECO           C63236VF845641              181140        DJDE  FORMAT=LVJFW V,FORMS=LVJFW1,END;
 V
 V CSTGECO           C63236VF845641              181140       1
 V
 V
 V CSTGECO           C63236VF845641              181140       0        BR/CO: ST/
 VECO                                     NACD: 1811   CONTROL# 63236VF
 V
 V CSTGECO           C63236VF845641              181140     < -
 V
 V
 V CSTGECO           C63236VF845641              181140     * -
 V
 V
 V CSTGECO           C63236VF845641              181140     % -
 V
 V
 | 
 
 Please let me know what shd be done to get proper result.
 _________________
 Thanks
 Madhu Sudhan
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Wed Apr 28, 2010 11:27 am    Post subject: |   |  
				| 
 |  
				| psmadhusudhan, 
 From what I see it is INDEED the right result. The 3rd record is CSTGECO           C63236VF845641. what am I missing here?  you are copying 3, 6, 9, 12, 15, .... record in input. Note that all space records are also considered as a record.
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| psmadhusudhan Beginner
 
  
 Joined: 28 Nov 2006
 Posts: 143
 Topics: 48
 
 
 | 
			
				|  Posted: Thu Apr 29, 2010 12:30 am    Post subject: |   |  
				| 
 |  
				| Kolusu 
 little correction I need every third record starting from first record, it means it should 1,4,7 like that.
 I am expecting following result:
 
 
  	  | Code: |  	  | A18112845641              STGECO    63236VF63236VF40           DJDE  FORMA A18112845641              STGECO    63236VF63236VF40          1
 A18112845641              STGECO    63236VF63236VF40          0        BR/
 A18112845641              STGECO    63236VF63236VF40        <    -
 A18112845641              STGECO    63236VF63236VF40        *    -
 A18112845641              STGECO    63236VF63236VF40        %    -
 | 
 Please let me if it is possible to achieve above result using skip or do I need to try with any other function.
 _________________
 Thanks
 Madhu Sudhan
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| superk Advanced
 
  
 Joined: 19 Dec 2002
 Posts: 684
 Topics: 5
 
 
 | 
			
				|  Posted: Thu Apr 29, 2010 6:29 am    Post subject: |   |  
				| 
 |  
				| Doesn't DFSORT have a SAMPLE command that could be (more easily) used for this? |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Apr 29, 2010 9:33 am    Post subject: |   |  
				| 
 |  
				| psmadhusudhan, 
 It is very easy to copy every 3rd record starting from the first record using DFSORT with SAMPLE option as superk pointed out
 
 use the following control cards
 
  	  | Code: |  	  | //SYSIN    DD *
 SORT FIELDS=COPY
 OUTFIL SAMPLE=3
 //*
 | 
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| psmadhusudhan Beginner
 
  
 Joined: 28 Nov 2006
 Posts: 143
 Topics: 48
 
 
 | 
			
				|  Posted: Mon May 03, 2010 12:25 am    Post subject: |   |  
				| 
 |  
				| Thanks for your help. It worked  _________________
 Thanks
 Madhu Sudhan
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |