Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare and COPY using DFSORT

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

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Fri Nov 17, 2017 9:49 am    Post subject: Compare and COPY using DFSORT
Reply with quote

Hi,

I have a requirement to compare 2 files. one is current day file and other is previous day's file. My compare is working perfectly.

Current day file is the unload of a VSAM file which will be renamed at the end of the job as previous day file. Current day has around 50MM records.

My question is, can I copy the records from first file during my compare step itself instead of having separate unload step, which is taking more time?

Please see my code below.


Code:

//*------------------------------------------------------------------
//*  STEP010 - UNLOAD CURRENT DB                                         
//*------------------------------------------------------------------
//STEP020  EXEC  PGM=SORT                                           
//SYSOUT   DD  SYSOUT=*                                             
//SORTIN   DD  DSN=&CURRFILE,DISP=SHR,                               
//             SUBSYS=(BDB2,'VIT=B2VVIT1','DD=CURRFL'),             
//             DCB=(RECFM=VB,LRECL=1454,BLKSIZE=27998)               
//SORTOUT  DD  DSN=AAA.BBB.CURRFL.UNLD,DISP=(NEW,CATLG),
//             UNIT=(SYSDA,5),                                       
//             SPACE=(CYL,(10,10),RLSE),                             
//             DCB=(RECFM=VB,LRECL=1454,BLKSIZE=27998)               
//DFSPARM  DD *             
   OPTION DYNALLOC=(SYSDA,16)
/*                           
//SYSIN    DD  *             
     SORT FIELDS=COPY     
//*--------------------------------------------------------------
//*  STEP030 - COMPARE PREVIOUS AND CURRENT FILES           
//*--------------------------------------------------------------
//STEP030  EXEC  PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//SORTJNF1 DD  DSN=AAA.BBB.CURRFL.UNLD,DISP=SHR         
//SORTJNF2 DD  DSN=AAA.BBB.PREVDAY.FILE,DISP=SHR         
//RFFWORK1 DD  DSN=AAA.BBB.STDWRK.TEMP1,             
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=(%%UNITB),                                   
//             SPACE=%%SPACE5,                                   
//             DCB=(RECFM=FB,LRECL=1450)                         
//RFFWORK2 DD  DSN=AAA.BBB.STDWRK.TEMP2,             
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=(%%UNITB),                                   
//             SPACE=%%SPACE5,                                   
//             DCB=(RECFM=FB,LRECL=1450)                         
//RFFWORK3 DD  DSN=AAA.BBB.STDWRK.TEMP3, 
//             DISP=(NEW,CATLG,DELETE),                   
//             UNIT=(SYSDA,5),                           
//             SPACE=(CYL,(10,10),RLSE),                 
//             DCB=(RECFM=FB,LRECL=1450)                 
//DFSPARM  DD *             
   OPTION DYNALLOC=(SYSDA,32)
/*                                                             
//SYSIN    DD  *                                               
  JOINKEYS FILE=F1,FIELDS=(35,23,A),SORTED,NOSEQCK             
  JOINKEYS FILE=F2,FIELDS=(35,23,A),SORTED,NOSEQCK             
  JOIN UNPAIRED,F1,F2                                           
  REFORMAT FIELDS=(F1:5,1450,F2:5,1450,?)                       
  OPTION COPY                                                   
    OUTFIL FNAMES=RFFWORK1,INCLUDE=(2901,1,CH,EQ,C'1'),         
      BUILD=(1,1450)                                           
    OUTFIL FNAMES=RFFWORK2,INCLUDE=(2901,1,CH,EQ,C'2'),         
      BUILD=(1451,28,C'D',1480,1421)                           
    OUTFIL FNAMES=RFFWORK3,                                     
      INCLUDE=(2901,1,CH,EQ,C'B',AND,(1,30,CH,NE,1451,30,CH,   
                                OR,54,256,CH,NE,1504,256,CH,   
                                OR,310,256,CH,NE,1760,256,CH,   
                                OR,566,256,CH,NE,2016,256,CH,   
                                OR,822,256,CH,NE,2272,256,CH,   
                                OR,1078,256,CH,NE,2528,256,CH, 
                                OR,1334,117,CH,NE,2784,117,CH)),
      BUILD=(1,1450)
/*                                           
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


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

PostPosted: Fri Nov 17, 2017 9:42 pm    Post subject:
Reply with quote

Why do you need STEP020 step?
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Sat Nov 18, 2017 11:22 pm    Post subject: Reply to: Compare and COPY using DFSORT
Reply with quote

Because I need current file and which will be ultimately renamed as previous day file in subsequent step so that it can be used in next day run.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Sat Nov 18, 2017 11:26 pm    Post subject:
Reply with quote

Why don’t you archive it in GDG AT THE END? What’s the ultimate problem here?
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 RegEx Support in DFSORT (z/OS 2.4) Joerg.Findeisen DFSORT/ICETOOL 3 Thu Nov 14, 2019 7:44 am
No new posts adrdssu for copy all data robyjhl JCL & VSAM 5 Tue Nov 12, 2019 11:17 pm
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
This topic is locked: you cannot edit posts or make replies. Compare two files logic in COBOL Nishant Singhal COBOL Programming 4 Sun Aug 25, 2019 2:25 am
No new posts IEBGENER to copy from FB to VB and re... Mike.Fulton All Other Mainframe Topics 3 Sat Aug 24, 2019 7:20 am

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