Posted: Sat Feb 06, 2010 3:09 pm Post subject: Exclude records present in File1 from File2 - DFSORT/ICETOOL
Hi,
Can anyone please give me the solution for the below requirement.
File1 has agent nos in Column 1 and in Column 51. The agent no field is 5 digits.
File2 has agents nos starting from Column 2 and is 5 digits.
I have to OMIT the agent nos present in File1 from File2. and the output can be in File2 itself. I have to exlcude all the agents present in File1 in column1 and in column 51 from File2.
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Sun Feb 07, 2010 10:06 am Post subject:
A0003 is in both files so what happens to that? You say only A0001 and A0004 get dropped but you are not showing A0003 in your output.
You say the output can be 'file 2 itself' - if you follow the threads in the forum you would know that that is a BAD thing to do. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Feb 08, 2010 11:45 am Post subject:
SAHANA,
The following DFSORT jcl will give you the desired results. Since you need to validate the account numbers in pos 1 and 51 , we concatenate the same file twice and using when=group we propagate the file number and key on to end of record and then sort on the common key.
Using another when=group we push the file number when there is match and get the desired results using an include on OUTFIL
I assumed that your input is FB recfm and 80 bytes LRECL
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
$$$
// DD DSN=Your file1 with actno at 1 and 51,DISP=SHR
// DD *
$$$
// DD DSN=Your file1 AGAIN with actno at 1 and 51,DISP=SHR
// DD *
$$$
// DD DSN=your file2 with act no at 1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(81:ID=1)),
IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(83:51,5)),
IFTHEN=(WHEN=(81,1,ZD,GT,1),OVERLAY=(83:01,5))
SORT FIELDS=(83,5,CH,A),EQUALS
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Feb 11, 2010 11:32 am Post subject:
SAHANA,
You could have saved a lot of time had you been clear with the requirements. You canNOT concatenate different FB LRECL files. Please provide detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
Any use the following DFSORT JCL which will give you the desired results
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