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
 
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: 78
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: 1827
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: 78
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: 1827
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 Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm

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