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 

Can this be done using dfsort ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Fri Aug 29, 2003 5:20 pm    Post subject: Can this be done using dfsort ? Reply with quote

The scenario

I have two files

first file has account details ,it includes account no field

second file has only account no

I want to delete all the records from the first file which has the account no same as in the second file ..there are few constraints for doing it..they are
the first file shouldnot be sorted

with out sorting the first file can we achieve the deletion...

is there a way to bring the acct no from the second file into the sysin statements..and achieve using OMIT condition

Thanks
manu
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Fri Aug 29, 2003 11:14 pm    Post subject: Reply with quote

Manu,

can you give us an example ?
Do you have Syncsort or Dfsort ?
Back to top
View user's profile Send private message
tidda
Beginner


Joined: 02 Dec 2002
Posts: 24
Topics: 6
Location: India

PostPosted: Fri Aug 29, 2003 11:25 pm    Post subject: Reply with quote

manu, check this thread. It may be of some help to you.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Aug 30, 2003 10:04 am    Post subject: Reply with quote

Manu,

If the "first file should not be sorted", then the ONLY way to do it would be to generate OMIT control conditions which you can certainly do with DFSORT. But there is a limit to the number of OMIT conditions you can use in one pass.

If you can sort the first file, then you can do this kind of thing with the SPLICE operator of DFSORT's ICETOOL and there's no limit to the number of records you can handle that way.

I'd need to know the following to tell you whether/how you can do this with DFSORT OMIT conditions:

How many records do you have in the second file?
What is the position, length and format of the account numbers in the second file? What is the position, length and format of the account numbers in the first file?
What is the RECFM and LRECL of the first file?
What is the RECFM and LRECL of the second file?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Tue Sep 02, 2003 5:25 pm    Post subject: Reply with quote

Hi

I am not able to reply imm..sorry about it

How many records do you have in the second file?
36,000
What is the position, length and format of the account numbers in the second file? What is the position, length and format of the account numbers in the first file?
The second file is of LRECL 12 and it contains only Acct number which is twelve bytes
In the first file the acct number (12 bytes) starts at 56th position,this file is of LRECL 765,Both files are FB

What is the RECFM and LRECL of the first file?
What is the RECFM and LRECL of the second file?

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


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Sep 02, 2003 11:21 pm    Post subject: Reply with quote

Manu,
Does you files have duplicates ? And as Alain had asked you, can you please post a sample of your input and output data.

Cheers,
Coolman.
________
Atenza


Last edited by coolman on Sat Feb 05, 2011 1:28 am; edited 1 time in total
Back to top
View user's profile Send private message
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Wed Sep 03, 2003 5:36 pm    Post subject: Reply with quote

i am using DFSORT

The second file doesn't have duplicates while the first file has many records with the same acct number



* ----> wild card character

sample data
Second file


1-----------12 ---> position in file
aaaaaaaa
ccccccccc
bbbbbbbb


First file

1------- 56---------67-------------------------------------755
******aaaaaaaaa*****************************
******xxxxxxxxx*****************************
******aaaaaaaaa*****************************
******cccccccccc*****************************
******bbbbbbbbb*****************************
******yyyyyyyyy*****************************
******yyyyyyyyy*****************************
******aaaaaaaaa*****************************
******bbbbbbbbb*****************************

the output file should be like this
1------ 56---------67-------------------------------------755
******xxxxxxxxx*****************************
******yyyyyyyyy*****************************
****** yyyyyyyyy*****************************

thanks
manu
Back to top
View user's profile Send private message
A.Benveniste
Beginner


Joined: 23 Jun 2003
Posts: 4
Topics: 0

PostPosted: Thu Sep 04, 2003 6:30 am    Post subject: Reply with quote

Manu,
You need PTF UQ90053 to execute this jcl.
I reduced the lrecl to 80 to give you the possibility to submit it 'as is' at your shop.
There is no constraint of 'OMIT' but perhaps of time : 7 passes are not efficient...
Code:

//STEP0001 EXEC PGM=ICETOOL
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IN1      DD *
AAAAAAAAAAAA
CCCCCCCCCCCC
BBBBBBBBBBBB
ZZZZZZZZZZZZ
/*
//IN2      DD *
RECORD NUMBER 1 ***************************************AAAAAAAAAAAA*************
RECORD NUMBER 2 ***************************************CCCCCCCCCCCC*************
RECORD NUMBER 3 ***************************************BBBBBBBBBBBB*************
RECORD NUMBER 4 ***************************************YYYYYYYYYYYY*************
RECORD NUMBER 5 ***************************************BBBBBBBBBBBB*************
RECORD NUMBER 6 ***************************************YYYYYYYYYYYY*************
RECORD NUMBER 7 ***************************************AAAAAAAAAAAA*************
RECORD NUMBER 8 ***************************************BBBBBBBBBBBB*************
RECORD NUMBER 9 ***************************************XXXXXXXXXXXX*************
/*
//OUT1     DD DSN=&&ST01FI01,
//            DISP=(MOD,DELETE,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1,0),RLSE),
//            DCB=(DSORG=PS,RECFM=FB,LRECL=86)
//OUT2     DD DSN=&&ST01FI02,
//            DISP=(NEW,DELETE,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1,0),RLSE),
//            DCB=(DSORG=PS,RECFM=FB,LRECL=86)
//OUT3     DD DSN=&&ST01FI03,
//            DISP=(MOD,DELETE,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1,0),RLSE),
//            DCB=(DSORG=PS,RECFM=FB,LRECL=86)
//OUT4     DD DSN=&&ST01FI04,
//            DISP=(NEW,DELETE,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1,0),RLSE),
//            DCB=(DSORG=PS,RECFM=FB,LRECL=86)
//OUTX     DD SYSOUT=*
//TOOLIN   DD *
  COPY   FROM(IN1)  TO(OUT1) USING(ICE0)
  COPY   FROM(IN2)  TO(OUT2) USING(ICE1)
  SELECT FROM(OUT2) TO(OUT1) ON(56,12,CH) FIRST -
                                          DISCARD(OUT3) -
                                          USING(ICE2)
  SPLICE FROM(OUT1) TO(OUT3) ON(56,12,CH) WITH(1,80) -
                                          WITH(82,5) -
                                          WITHALL -
                                          KEEPNODUPS
  SORT   FROM(OUT3) TO(OUT2) USING(ICE3)
  SPLICE FROM(OUT2) TO(OUT4) ON(56,12,CH) WITH(1,80) -
                                          WITH(82,5) -
                                          WITHALL -
                                          KEEPNODUPS
  SORT   FROM(OUT4) TO(OUTX) USING(ICE4)
/*
//ICE0CNTL DD *
  OUTREC FIELDS=(56:1,12,81:C'X     ')
/*
//ICE1CNTL DD *
  OUTREC FIELDS=(1:1,80,81:C' ',82:SEQNUM,5,ZD,START=0,INCR=1)
/*
//ICE2CNTL DD *
  OUTFIL FNAMES=OUT1,
         REPEAT=3
/*
//ICE3CNTL DD *
  SORT FIELDS=(82,5,ZD,A)
/*
//ICE4CNTL DD *
  SORT   FIELDS=(82,5,ZD,A)
  OMIT   COND=(81,1,CH,EQ,C'X')
  OUTREC FIELDS=(1:1,80)
/*

OUTX gives :
Code:

RECORD NUMBER 4 ***************************************YYYYYYYYYYYY*************
RECORD NUMBER 6 ***************************************YYYYYYYYYYYY*************
RECORD NUMBER 9 ***************************************XXXXXXXXXXXX*************

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


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

PostPosted: Thu Sep 04, 2003 9:21 am    Post subject: Reply with quote

Manu,

Generating the omit cards will work only if the no: records are less than 5000( for a key length of 12 bytes).But your second input file has about 36,000 records which is way too much for generating omit cards.If you have DFSORT'S latest PTF installed then may be you can do it with splice operator as shown by alan. I wouldn't recommend that also it makes 7 passes of data. If you have easytrieve at your shop then it is very easy and simple. The following JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=EZTPA00                       
//*                                               
//STEPLIB  DD DSN=EASYTREV.LOADLIB,     
//            DISP=SHR                             
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SYSSNAP  DD SYSOUT=*                             
//SYSUDUMP DD SYSOUT=*                             
//FILEONE  DD DSN=YOUR 765 LRECL FILE WITH DUPLICATES,     
//            DISP=SHR                             
//FILETWO  DD DSN=YOUR ACCOUNT NO: FILE,     
//            DISP=SHR                             
//OUTPUT   DD DSN=YOUR OUTPUT UNMATCHED FILE,             
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,                           
//            SPACE=(CYL,(X,Y),RLSE),           
//            DCB=(LRECL=765,RECFM=FB,BLKSIZE=0)   
//*
//SYSIN    DD *                                                       

                                                                       
  FILE FILEONE                                                         
       ACCT-NO1         56 012 A                                       
                                                                       
  FILE FILETWO                                                         
       ACCT-NO2         01 012 A                                       
                                                                       
                                                                       
  FILE OUTPUT  FB(0 0)                                                 
                                                                       
***********************************************************************
* MAINLINE                                                            *
***********************************************************************
                                                                       
 JOB INPUT (FILETWO   KEY (ACCT-NO2)  +                               
            FILEONE   KEY (ACCT-NO1))                                 
                                                                       
   IF MATCHED                                                         
      CONTINUE                                                         
   ELSE                                                               
       IF FILEONE                                                     
          PUT OUTPUT FROM FILEONE                                     
       END-IF                                                         
   END-IF                                                             
                                                                       
//*     


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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