Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Write out NODUPS but just from one file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Jay Villaverde

New User


Joined: 08 Mar 2014
Posts: 27
Location: USA

PostPosted: Fri Jul 14, 2017 12:44 am    Post subject: Write out NODUPS but just from one file
Reply with quote

Hi. I have two files and I need to write out just the unique records from one of the files.

This is current my code which if I run as is will give me the uniques from both files:

Code:

//DUPECHK2 JOB (31000,G5),'JAY',CLASS=F,MSGCLASS=2,                     
//         NOTIFY=&SYSUID TYPRUN=HOLD                                   
//S1SORT   EXEC PGM=SORT,REGION=3072K                                   
//**********************************************************************
//SORTIN   DD DISP=SHR,DSN=TST.WAY.H6541.JUL171X                       
//**********************************************************************
//SORTOUT DD DISP=(NEW,PASS),DSN=&&FILE1,                               
//           SPACE=(CYL,(500,100),RLSE,,ROUND),UNIT=SYSDA,             
//           DCB=(RECFM=FB,LRECL=441,BLKSIZE=27783)                     
//*           DCB=*.SORTIN                                             
//SYSOUT  DD SYSOUT=6                                                   
//SYSIN   DD *                                                         
*                                                                       
*INCLUDE COND=(364,002,CH,EQ,C'PR')                                     
*                                                                       
*OMIT COND=(023,04,CH,EQ,C'1311')                                       
*                                                                       
*SORT FIELDS=COPY                                                       
 SORT FIELDS=(01,441,CH,A)                                             
*SUM FIELDS=NONE                                                       
 OPTION DYNALLOC                                                       
/*                                                                     
//S2SORT   EXEC PGM=SORT,REGION=3072K                                   
//**********************************************************************
//SORTIN   DD DISP=SHR,DSN=ATR.DDW.H6541.JUL171                         
//**********************************************************************
//SORTOUT DD DISP=(NEW,PASS),DSN=&&FILE2,                               
//           SPACE=(CYL,(500,100),RLSE,,ROUND),UNIT=SYSDA,             
//           DCB=(RECFM=FB,LRECL=441,BLKSIZE=27783)                     
//*           DCB=*.SORTIN                                             
//SYSOUT  DD SYSOUT=6                                                   
//SYSIN   DD *                                                         
*                                                                       
*INCLUDE COND=(364,002,CH,EQ,C'PR')                                     
*                                                                       
*OMIT COND=(023,04,CH,EQ,C'1311')                                       
*                                                                       
*SORT FIELDS=COPY                                                       
 SORT FIELDS=(01,441,CH,A)                                             
*SUM FIELDS=NONE                                                       
 OPTION DYNALLOC                                                       
/*                                                                     
//**********************************************************************
//*****   S2ICE: OUTPUT ALL OR NO DUPES ON SUPPLIED CRITERIA       *****
//**********************************************************************
//S2ICE EXEC PGM=ICETOOL                                               
//TOOLMSG DD SYSOUT=*                                                   
//DFSMSG DD SYSOUT=*                                                   
//IN      DD DISP=SHR,DSN=&&FILE1                                       
//        DD DISP=SHR,DSN=&&FILE2                                       
//OUT     DD DISP=(NEW,CATLG,DELETE),                                   
//           DSN=TST.WAY.X6541.NODUPES,                                 
//           SPACE=(CYL,(500,100),RLSE,,ROUND),UNIT=TEST,               
//           DCB=(RECFM=FB,LRECL=441,BLKSIZE=27783)                     
//*           DCB=*.IN                                                 
//TOOLIN DD *                                                           
  SELECT FROM(IN) TO(OUT) -       
  ON(01,441,CH) NODUPS           
//                               


Thanks
Back to top
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 214
Location: Maryland

PostPosted: Fri Jul 14, 2017 2:44 am    Post subject:
Reply with quote

If you need "just the unique records from one of the files" then you don't need the second dataset at all. Eliminate duplicates from the first dataset, and forget about the second one, that's it.

I guess you do not understand your task yet? Or cannot explain it to the public?

Your question as it is now doesn't make sense, at all.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 967
Location: Richmond, Virginia

PostPosted: Fri Jul 14, 2017 9:03 am    Post subject:
Reply with quote

I recommend that when posting your code, first remove the commented and other extraneous lines so that others need not wade through them to see what you are doing.

Make it as easy as possible for folks to help you.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jul 14, 2017 6:15 pm    Post subject:
Reply with quote

Jay - Is there anything within the data by which you can identify the source data set? If yes, concatenate both the original data sets and assign a sequence number ONLY for records from one of the data sets (the one you don't want to eliminate dups from). Make sure you have blanks (or some default value) in this field for records from the other data set. Then include the sequence number field in your SORT FIELDS and then eliminate duplicates.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1819
Location: NY,USA

PostPosted: Fri Jul 14, 2017 8:28 pm    Post subject:
Reply with quote

Jay, Sergeyken is right. Understand the task first and then start working on it otherwise its a waste of time.
Arun Raj, Why even involved the other dataset at first place? Just get rid of the dups from one dataset and concatenate later with other dataset .
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jul 14, 2017 9:18 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Arun Raj, Why even involved the other dataset at first place? Just get rid of the dups from one dataset and concatenate later with other dataset .
Rohit Umarjikar,

Because from the OP's control statements above, he does sort the other data set as well on the key. Concatenation will not help if this is what the OP wants to do.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1819
Location: NY,USA

PostPosted: Fri Jul 14, 2017 10:09 pm    Post subject:
Reply with quote

Quote:
Because from the OP's control statements above, he does sort the other data set as well on the key. Concatenation will not help if this is what the OP wants to do.
Sort keys are still same and can be done independently, if I understand the OP's question.
1.Eliminate dups from Dataset 1
2.Concate Dataset from step1, and dataset 2 with SORT ( same key for both).
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 408
Location: USA

PostPosted: Fri Jul 14, 2017 10:24 pm    Post subject: Reply to: Write out NODUPS but just from one file
Reply with quote

File1:
Code:
ABC1
ABC1
PQR2
XYZ3

File2:
Code:
BCD1
PQR2
MNO3

Will PQR2 be considered as a Unique record?

Since Sort key is same as record length, the whole record has to be a duplicate. If PQR2 needs to be removed then, it doesn't mean anything if it is removed from file1 or file2.

.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jul 14, 2017 10:25 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Sort keys are still same and can be done independently

Rohit Umarjikar,

You can do it in a single pass with concatenated original input data sets and a single output data set, provided the given conditions satisfy. You don't really need to 'separate' the processing and do it 'independently' if that is the case.
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 Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us