MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copy Every 3rd record using IEBPTPCH

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Wed Apr 28, 2010 5:21 am    Post subject: Copy Every 3rd record using IEBPTPCH Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Apr 28, 2010 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Thu Apr 29, 2010 12:30 am    Post subject: Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Apr 29, 2010 6:29 am    Post subject: Reply with quote

Doesn't DFSORT have a SAMPLE command that could be (more easily) used for this?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 29, 2010 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Mon May 03, 2010 12:25 am    Post subject: Reply with quote

Thanks for your help. It worked Smile
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group