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

Compare and COPY using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Nov 17, 2017 9:42 pm
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
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

Global Moderator


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

PostPosted: Sat Nov 18, 2017 11:26 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top