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

how to keep unpaired records with REPRO.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Fri Nov 11, 2022 8:52 pm
Reply with quote

Hello, how are you? Im using the next repro, with 2 ps files.
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,DISP=SHR
//SYSIN DD *
REPRO INFILE (SORTIN) OUTFILE (SORTOUT) REPLACE

The files are:

Sortin
A
B
C


Sortout
A
B
C
D
E


When I run the repro I see that the sortout file only keeps

A
B
C


How can I do to keep all the data and not only what paired?




Thank you again.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Nov 11, 2022 10:00 pm
Reply with quote

See description of REPLACE, and REPRO in general.
Back to top
View user's profile Send private message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Fri Nov 11, 2022 10:07 pm
Reply with quote

Joerg.Findeisen wrote:
See description of REPLACE, and REPRO in general.


I searched but there is no much info, I cant find no idcams guide and in www.mainframestechhelp.com/utilities/idcams/repro.htm neither.

Is there a way trhough repro to do the thing I want ?

thanks
Back to top
View user's profile Send private message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Fri Nov 11, 2022 11:08 pm
Reply with quote

I just wanted to know if there is a a way to achieve this using repro or merge. I tried several times but I cant achieve the desired result.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Mon Nov 14, 2022 5:49 am
Reply with quote

Would a cluster defined with REUSE behave this way?
Back to top
View user's profile Send private message
Ali_gezer

Active User


Joined: 06 Apr 2021
Posts: 123
Location: argentina

PostPosted: Mon Nov 14, 2022 5:54 am
Reply with quote

dneufarth wrote:
Would a cluster defined with REUSE behave this way?

I will try it tomorrow, I used a ps file.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2133
Location: USA

PostPosted: Mon Nov 14, 2022 5:55 am
Reply with quote

Ali_gezer wrote:
Hello, how are you? Im using the next repro, with 2 ps files.
Code:
//SORTIN   DD DSN=FILE1,DISP=SHR
//SORTOUT  DD DSN=FILE2,DISP=SHR
//SYSIN    DD *
REPRO INFILE (SORTIN) OUTFILE (SORTOUT) REPLACE


The files are:

Sortin
Code:
A
B
C


Sortout
Code:
A
B
C
D
E


When I run the repro I see that the sortout file only keeps

Code:
A
B
C


How can I do to keep all the data and not only what paired?

Thank you again.

Can you please clarify: where the two records, D, and E, can appear in SORTOUT when missing from SORTIN???

P.S.
Remember, you still need to RTFM about SORT

P.P.S.
REPRO in either IDCAMS or SORT has nothing to do with neither paired, nor unpaired records. Read about SORT, not IDCAMS
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Mon Nov 14, 2022 6:14 am
Reply with quote

Perhaps I'm confused by REPRO and ddnames of SORTxxx

If I recall, IDCAMS REPRO to a KSDS (with no ALTindex) should replace individual records in output with input records having a matching key.

It will take another utility/program to achieve that in a PS dataset.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Mon Nov 14, 2022 7:40 am
Reply with quote

Cleaned up unwanted posts .. please stick to the forum rules.

However to achieve what you want can be done easily using DFSORT/SYNCSORT using JOINKEYS .
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Mon Nov 14, 2022 12:02 pm
Reply with quote

Code:
REPLACE                                                                 
                                                                         
    When a key-sequenced data set (other than a catalog) is copied, each
    source record with a key matching a target record's key replaces the
    target record. Otherwise, the source record is inserted into its     
    appropriate place in the target cluster.                             
                                                                         
    When a relative record data set is copied, each source record with a
    relative record number that identifies a data record (rather than an
    empty slot) in the target data set replaces the target data record. 
    Otherwise, the source data record is inserted into the empty slot its
    relative record number identifies.


depending on the VSAM type, this could also apply:
Code:
REUSE                                                                   
                                                                         
    specifies that the target data set, specified with OUTFILE or       
    OUTDATASET, is opened as a reusable data set whether or not it was   
    defined as reusable with the REUSE parameter. (See the DEFINE CLUSTER
    command description.) If the data set was defined with REUSE, its   
    high-used relative byte address (RBA) is reset to zero (that is, the
    data set is effectively empty) and the operation proceeds. When you 
    open a reusable data set with the reset option, that data set cannot
    be shared with other jobs.                                           
                                                                         
    If REUSE is specified and the data set was originally defined with   
    the NOREUSE option, the data set must be empty; if not, the REPRO   
    command ends with an error message.

NOREUSE                                                                 
                                                                       
    specifies that records are written at the end of an entry-sequenced
    data set. (OUTFILE or OUTDATASET must identify a nonempty data set.)
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top