MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

create dfsort report of changes and a file of new adds
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Thu Jun 26, 2008 5:33 pm    Post subject: Reply with quote

tlhceh,

Assuming that you are running the same job as OP, change the CTL2CNTL to the following.Look at the the OUTREC BUILD statement which builds current date and yesterday's date in ccyy-mm-dd format

Code:

//CTL1CNTL DD *                                                       
  OPTION EQUALS                                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,14,5Z,SEQNUM,1,ZD,RESTART=(1,11))),
  IFTHEN=(WHEN=(20,1,ZD,EQ,2),OVERLAY=(16:12,3,Z,12:4Z))             
  SORT FIELDS=(1,11,CH,A)                                             
  SUM FIELDS=(12,4,BI,16,4,BI)                                       
  OUTREC BUILD=(1,11,12,8,TRAN=ALTSEQ,DATE1(-),DATE1(-)-1)           
  ALTSEQ CODE=(0040)                                                 
  OUTFIL FNAMES=RPT,REMOVECC,                                         
  BUILD=(1:1,11,13:12,3,25:16,3,50:X),                               
  HEADER1=('AGENT ID   ',20,10,2X,30,10,/,                           
           '========    ==========  ==========')                     
/*


This would produce the report as

Code:

AGENT ID   2008-06-26  2008-06-25     
========    ==========  ==========   
1234567     Y I         Y O           
3456        Y I         Y O           
5678912     N I                       


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tlhceh
Beginner


Joined: 21 Nov 2006
Posts: 6
Topics: 1
Location: Central Illinois

PostPosted: Fri Jun 27, 2008 7:15 am    Post subject: Reply with quote

Kolusu

Actually I am using the original example you provided:
Code:

//TOOLIN   DD *                                                       
  SELECT FROM(IN) TO(T1) ON(1,18,CH) NODUPS                           
  SELECT FROM(T1) TO(RPT) ON(1,12,CH) ALLDUPS DISCARD(NEW) USING(CTL1)
//CTL1CNTL DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(42:SEQNUM,1,ZD,RESTART=(1,12))),   
  IFTHEN=(WHEN=(42,1,ZD,EQ,2),OVERLAY=(43:13,5,13:5C'0'))             
  OUTFIL FNAMES=RPT,REMOVECC,NODETAIL,                               
  HEADER1=(3:'  UID    ',2X,'DATE',2X,'YESTERDAY',/,                 
           3:'=========',2X,'=====',2X,'=========',/),               
  SECTIONS=(1,12,                                                     
  TRAILER3=(3:3,9,2X,TOT=(13,5,ZD,M10,LENGTH=5),2X,                   
            TOT=(43,5,ZD,M10,LENGTH=5)))                             
  OUTFIL FNAMES=NEW,BUILD=(1,38,C'1;1')                               

someone else highjacked the thread to ask a similar question for which you provided a slightly different example. I have tried to put DATE1(-) in the header1 line but I get syntax error and I can not find an example of this in the links to manuals.
Thanks for any assistance you provide.

Tom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Fri Jun 27, 2008 10:17 am    Post subject: Reply with quote

tlhceh,

Sorry. Just got mixed up. Just change your CTL1CNTL to the following

Code:

//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(42:SEQNUM,1,ZD,RESTART=(1,12),
                 5X,DATE1(-),DATE1(-)-1)),                       
  IFTHEN=(WHEN=(42,1,ZD,EQ,2),OVERLAY=(43:13,5,13:5C'0'))         
  OUTFIL FNAMES=RPT,REMOVECC,NODETAIL,                           
  HEADER1=(3:'KEY FIELD',2X,48,10,2X,58,10,/,                     
           3:'=========',2X,10'=',2X,10'=',/),                   
  SECTIONS=(1,12,                                                 
  TRAILER3=(3:3,9,2X,TOT=(13,5,ZD,M10,LENGTH=5),2X,               
            26:TOT=(43,5,ZD,M10,LENGTH=5)))                       
  OUTFIL FNAMES=NEW,BUILD=(1,38,C'1;1')                           
//*                                                               


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tlhceh
Beginner


Joined: 21 Nov 2006
Posts: 6
Topics: 1
Location: Central Illinois

PostPosted: Fri Jun 27, 2008 12:23 pm    Post subject: Reply with quote

Kolusu

That works great! Thanks you for your assistance. I now need to read up on the ifthen when options in DFSORT so I can better understand and write these myself. Thanks for the example.

Tom
Back to top
View user's profile Send private message
tlhceh
Beginner


Joined: 21 Nov 2006
Posts: 6
Topics: 1
Location: Central Illinois

PostPosted: Thu Jul 24, 2008 7:38 pm    Post subject: Reply with quote

Kolusu

I sent this to you in a PM but haven't heard back so I thought I might submit to the board for input from others. ....... please don't take that the wrong way I know you are busy and I am just trying to get a solution.

I have discovered what I consider an error in the processing of comparing yesterday file to today's file. If a record exists in yesterday's file but not todays it is being sent to the newly added file. It should not be considered new. Embarassed I did not think of this situation before. It should be sent to a third file of canceled records. Here is code we are utilizing at this time:
Code:

//STEP06   EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=Todays file,DISP=SHR                       
//         DD DSN=yesterdays file,DISP=SHR                 
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)           
//*RPT      DD SYSOUT=*                                               
//RPT       DD DSN=change record report,                           
//   DCB=(RECFM=FB,LRECL=45,BLKSIZE=0),DISP=(,CATLG,DELETE),         
//*  DCB=(RECFM=FB,LRECL=47,BLKSIZE=0),DISP=(,CATLG,DELETE),         
//   SPACE=(CYL,(01,1),RLSE)                                         
//*NEW      DD SYSOUT=*                                               
//NEW      DD DSN=new record report,                           
//   DCB=(RECFM=FB,LRECL=39,BLKSIZE=27963),DISP=(,CATLG,DELETE),     
//   SPACE=(CYL,(01,2),RLSE)                                         
//*                                                                   
//TOOLIN   DD *                                                       
  SELECT FROM(IN) TO(T1) ON(1,16,CH) NODUPS                           
  SELECT FROM(T1) TO(RPT) ON(1,12,CH) ALLDUPS DISCARD(NEW) USING(CTL1)
//CTL1CNTL DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(40:SEQNUM,1,ZD,RESTART=(1,12),
                 3X,DATE1(/),DATE1(/)-1)),                       
  IFTHEN=(WHEN=(40,1,ZD,EQ,2),OVERLAY=(41:13,3,13:3C'0'))         
  OUTFIL FNAMES=RPT,REMOVECC,NODETAIL,                           
  HEADER1=(3:'      record plan changes ',/,                     
           3:'  UID    ',2X,44,10,2X,54,10,/,                     
           3:'=========',2X,10'=',2X,10'=',/),                   
  SECTIONS=(1,12,                                                 
  TRAILER3=(3:3,9,4X,TOT=(13,3,ZD,M10,LENGTH=3),2X,               
            28:TOT=(41,3,ZD,M10,LENGTH=3)))                       
  OUTFIL FNAMES=NEW,BUILD=(1,36,C'1;1')                           



YESTERDAYS FILE:
Code:
Code:

C;123456789;600;01901;18;++00015000;0;0
C;213456789;600;01901;18;++00015000;0;0
C;312456789;626;01834;18;++00035000;0;0


TODAYS FILE
Code:
Code:

C;123456789;600;01901;18;++00015000;0;0
C;312456789;600;01901;18;++00015000;0;0
C;412356789;626;01834;18;++00035000;0;0


What I expect from here is the following:
record 312456789 should be in the changed file
record 412356789 should be in the new file
record 213456789 should be in a new file called canceled file as it was in yesterdays file but not in todays file. This record currently shows up in the new file and will cause processing issues.
record 123456789 should not be reported in any file as it was the same in both yesterdays file and todays file.

I hope I have explained this thoroughly enough and I apologize for not thinking of this scenario earlier. I know I can, in a separate step, identify the problem record 213456789 but the problem is it can not show up in the new file. How would you suggest to solve this issue?

Thanks in advance for any help.

I have tried to put in a step prior to eliminate the canceled records with the intention of of making a separate report of canceled records with the following code and for some reason it is not picking out the records from yesterdays file that are not in today's file. Here is code I tried:

Code:

//STEP2 EXEC  PGM=ICETOOL                                       
//TOOLMSG DD SYSOUT=*                                           
//DFSMSG DD SYSOUT=*                                           
//IN1  DD DSN=yesterdays file,DISP=SHR         
//IN2  DD DSN=todays file,DISP=SHR         
//*T1   DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,2)),DISP=(MOD,PASS)
//TLH  DD DSN=TADM.TLHUNTS,UNIT=SYSDA,SPACE=(CYL,(5,2)),       
//        DISP=(,CATLG,CATLG),DCB=(RECFM=FB,LRECL=40,BLKSIZE=0)
//OUT1 DD DSN=CANCELED.file,UNIT=SYSDA,                 
//      DISP=(,CATLG,CATLG),                                   
//      SPACE=(CYL,(50,9),RLSE)                                 
//TOOLIN DD *                                                   
COPY FROM(IN1) TO(TLH) USING(CTL1)                             
COPY FROM(IN2) TO(TLH) USING(CTL2)                             
SELECT FROM(TLH) TO(OUT1) ON(1,16,CH) NODUPS USING(CTL3)       
/*                                                             
//CTL1CNTL DD *                                                 
* IN1 -> T1; T1:  ADD '1' ID TO IN1 RECORDS                     
  INREC OVERLAY=(40:C'1')                                     
/*                                                           
//CTL2CNTL DD *                                               
* IN2 -> T2; T2:  ADD '2' ID TO IN2 RECORDS                   
  INREC OVERLAY=(40:C'2')                                     
/*                                                           
//CTL3CNTL DD *                                               
* KEEP ONLY NODUPS RECORDS WITH '1' ID.                       
* REMOVE ID.                                                 
   OUTFIL FNAMES=OUT1,INCLUDE=(40,1,CH,EQ,C'1'),             
   BUILD=(1,39)                                               
//                                                           


I would still like to be able to create both reports (canceled and changed) and the new file all in one step but I can see that is a lot of processing for one step.

Thanks for any and all help
Tom Confused
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Fri Jul 25, 2008 11:26 am    Post subject: Reply with quote

tlhceh,

Sorry busy with work and couldnt' respond to your private message . The following DFSORT/ICETOOL job will give you the desired results. We just need an additional pass to identify the data if it is from yesterday or today. So I added 2 copy operators to copy the files with the indicators. If you can create the files with the indicators then you can skip the first 2 steps. Make sure to have DISP=MOD for T1 temp dataset


Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//YEST     DD *                                               
C;123456789;600;01901;18;++00015000;0;0                       
C;213456789;600;01901;18;++00015000;0;0                       
C;312456789;626;01834;18;++00035000;0;0                       
//TODAY    DD *                                               
C;123456789;600;01901;18;++00015000;0;0                       
C;312456789;600;01901;18;++00015000;0;0                       
C;412356789;626;01834;18;++00035000;0;0                       
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//T2       DD DSN=&&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//RPT      DD SYSOUT=*                                       
//NEW      DD SYSOUT=*                                       
//CAN      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(YEST)  TO(T1) USING(CTL1)                         
  COPY FROM(TODAY) TO(T1) USING(CTL2)                         
  SELECT FROM(T1)  TO(T2) ON(1,16,CH) NODUPS                 
  SORT FROM(T2) USING(CTL3)                                   
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,BUILD=(1,39,C'Y')                         
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=T1,BUILD=(1,39,C'T')                         
//CTL3CNTL DD *                                               
  INREC IFTHEN=(WHEN=INIT,                                     
  OVERLAY=(41:SEQNUM,1,ZD,RESTART=(1,12),3C'0')),             
  IFTHEN=(WHEN=(41,1,ZD,EQ,2),OVERLAY=(42:13,3,13:3C'0'))     

  SORT FIELDS=(1,12,CH,A)                                     

  SUM FIELDS=(13,3,41,1,42,3),FORMAT=ZD                       
                                                               
  OUTREC OVERLAY=(45:DATE1(-),DATE1(-)-1)                     
                                                               
  OUTFIL FNAMES=RPT,INCLUDE=(41,1,ZD,EQ,3),                   
  REMOVECC,NODETAIL,                                           
  HEADER1=(3:'KEY FIELD',2X,45,10,2X,55,10,/,                 
           3:'=========',2X,10'=',2X,10'=',/),                 
  SECTIONS=(1,12,                                             
  TRAILER3=(3:3,9,4X,TOT=(13,3,ZD,M10,LENGTH=3),2X,           
            28:TOT=(42,3,ZD,M10,LENGTH=3)))                   
  OUTFIL FNAMES=NEW,BUILD=(1,36,C'1;1'),                       
  INCLUDE=(40,1,CH,EQ,C'T',AND,42,3,ZD,EQ,0)                   
  OUTFIL FNAMES=CAN,                                           
  INCLUDE=(40,1,CH,EQ,C'Y',AND,42,3,ZD,EQ,0),                 
  BUILD=(1,39)                                                 
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tlhceh
Beginner


Joined: 21 Nov 2006
Posts: 6
Topics: 1
Location: Central Illinois

PostPosted: Fri Jul 25, 2008 2:37 pm    Post subject: Reply with quote

Kolusu

No need to apologize for being busy with work. I understand. I almost had the job figured out by adding a step prior to the icetool step you had given me. But I like the fact that this is completed in one ice tool step. I am unable to create the records with indicators at the end so I will need to leave the first two steps in place. I thank you very much for your assistance regarding this process. I am now trying to convert the canceled file into a report just as the changed report. We will see how that goes.

Thanks again

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group