I have a request to copy, set of alternate records from 2 PS



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

I have a request to copy, set of alternate records from 2 PS

Postby saveragu » Tue Feb 02, 2016 1:17 am

I have a request to copy, set of alternate records from 2 PS file to another PS file using Sort JCl.
All three files have record length 80 and fixed record format.
Am using Sort JCl to achieve this.With the help of this forum i could copy the alternative records to 3rd PS file, but am struck with copying set of alternate records as shown in the below example. Any suggestion/help is really appreciated.
Example:
Input File1:
Record1
Record2
Record3
Record4
Record5
Record6
Record7
Record8
Record9
Record10


Input File2:
Record11
Record12
Record13
Record14
Record15
Record16
Record17
Record18
Record19
Record20


Ouput File3:
Record1
Record2
Record3
Record11
Record12
Record4
Record5
Record6
Record13
Record14
Record7
Record8
Record9
Record15
Record16
....
....
<EOM>
saveragu
 
Posts: 4
Joined: Tue Feb 02, 2016 1:11 am
Has thanked: 1 time
Been thanked: 0 time

Re: I have a request to copy, set of alternate records from 2 PS

 

Re: I have a request to copy, set of alternate records from

Postby saveragu » Tue Feb 02, 2016 1:24 am

Below is my JCL i used to achieve to copy alternate records from 2 different PS file to another PS file.

//SORTST EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=Input.FILE1
//IN2 DD DISP=SHR,DSN=Input.FILE2
//SORTOUT DD DISP=SHR,DSN=Output.FILE3,
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(81,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(81,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,80,F2:1,80)
OPTION COPY
OUTFIL BUILD=(1,80,/,81,80)
//JNF1CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
//JNF2CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
/*



saveragu wrote:I have a request to copy, set of alternate records from 2 PS file to another PS file using Sort JCl.
All three files have record length 80 and fixed record format.
Am using Sort JCl to achieve this.With the help of this forum i could copy the alternative records to 3rd PS file, but am struck with copying set of alternate records as shown in the below example. Any suggestion/help is really appreciated.
Example:
Input File1:
Record1
Record2
Record3
Record4
Record5
Record6
Record7
Record8
Record9
Record10


Input File2:
Record11
Record12
Record13
Record14
Record15
Record16
Record17
Record18
Record19
Record20


Ouput File3:
Record1
Record2
Record3
Record11
Record12
Record4
Record5
Record6
Record13
Record14
Record7
Record8
Record9
Record15
Record16
....
....
<EOM>
saveragu
 
Posts: 4
Joined: Tue Feb 02, 2016 1:11 am
Has thanked: 1 time
Been thanked: 0 time

Re: I have a request to copy, set of alternate records from

Postby BillyBoyo » Tue Feb 02, 2016 2:32 pm

Do you mean you have what you want, or you are still wanting assistance? Your code won't give you the output you've shown.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: I have a request to copy, set of alternate records from

Postby NicC » Tue Feb 02, 2016 8:12 pm

Please post in the correct part of the forum - this is not a JCL question. Also, please use the code tags to present code and data.

This is your JCL
//SORTST EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=Input.FILE1
//IN2 DD DISP=SHR,DSN=Input.FILE2
//SORTOUT DD DISP=SHR,DSN=Output.FILE3,
//SYSIN DD *
//JNF1CNTL DD *
//JNF2CNTL DD *
/*

and these are your sort control cards (they are not JCL)

SYSIN:
JOINKEYS F1=IN1,FIELDS=(81,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(81,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,80,F2:1,80)
OPTION COPY
OUTFIL BUILD=(1,80,/,81,80)

JNF1CNTL
INREC OVERLAY=(81:SEQNUM,8,ZD)

JNF2CNTL
INREC OVERLAY=(81:SEQNUM,8,ZD)
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
saveragu (Wed Feb 03, 2016 2:32 am)
NicC
Global moderator
 
Posts: 2676
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 102 times

Re: I have a request to copy, set of alternate records from

Postby saveragu » Wed Feb 03, 2016 2:32 am

Thanks NicC for your reply. You code worked perfectly well.
Going forward will post the question in the right format and at right place of the forum.

NicC wrote:Please post in the correct part of the forum - this is not a JCL question. Also, please use the code tags to present code and data.

This is your JCL
//SORTST EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=Input.FILE1
//IN2 DD DISP=SHR,DSN=Input.FILE2
//SORTOUT DD DISP=SHR,DSN=Output.FILE3,
//SYSIN DD *
//JNF1CNTL DD *
//JNF2CNTL DD *
/*

and these are your sort control cards (they are not JCL)

SYSIN:
JOINKEYS F1=IN1,FIELDS=(81,8,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(81,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,80,F2:1,80)
OPTION COPY
OUTFIL BUILD=(1,80,/,81,80)

JNF1CNTL
INREC OVERLAY=(81:SEQNUM,8,ZD)

JNF2CNTL
INREC OVERLAY=(81:SEQNUM,8,ZD)
saveragu
 
Posts: 4
Joined: Tue Feb 02, 2016 1:11 am
Has thanked: 1 time
Been thanked: 0 time

Re: I have a request to copy, set of alternate records from

Postby saveragu » Wed Feb 03, 2016 2:35 am

BillyBoyo wrote:Do you mean you have what you want, or you are still wanting assistance? Your code won't give you the output you've shown.


Thanks Billy for your reply. Am good now.
saveragu
 
Posts: 4
Joined: Tue Feb 02, 2016 1:11 am
Has thanked: 1 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post