View previous topic :: View next topic
|
Author |
Message |
Nanda Krishna
New User
Joined: 30 Nov 2005 Posts: 19 Location: Bangalore
|
|
|
|
Suppose, I have file with '10' records. The header is showing the count of all records in the file. This file has some duplicate records.... say for ex. 2 duplicate records.
I need to create a new file by remove the duplicate records and updating count in the header record. i.e. my new file should have 8 records (after removing the 2 duplicate records from the file of 10 records) and header record should show the count as 8.
Please note that record counts and duplicate records will vary from file to file. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Nanda Krishna
Give the sample set of i/p records, with the header format.
and also the o/p records. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Also, give the RECFM and LRECL of the input file and the starting position, length and format of the field you are using to check for duplicates. |
|
Back to top |
|
|
Nanda Krishna
New User
Joined: 30 Nov 2005 Posts: 19 Location: Bangalore
|
|
|
|
* RECFM = VB
* LRECL = 304
* starting position, length and format of the field you are using to check
for duplicates = (1, 13, CHAR) i.e. SORT FIELDS=(1,13,CH,A)
* In the header, record count is from pos 59-62 (length of 4 char)
* Input file and Output file are of same format and length.
Please let me know if you need any other information. Thanks in Advance |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Please let me know if you need any other information. |
Please show an example of the records in the input file (just the relevant fields) and the records you expect in the output file. |
|
Back to top |
|
|
Nanda Krishna
New User
Joined: 30 Nov 2005 Posts: 19 Location: Bangalore
|
|
|
|
Sample input file:
--------------------
Code: |
Header:
---------
AX00 20070804025000RAMTX00056790 00000000051357
* Here 0005 is the records count excluding hdr record and it starts
from pos. 59
Detail records:
-----------------
DRAPBBXA0
DRAPBBXA1
DRAPBBXA2 --> Duplicate record
DRAPBBXA2 --> Duplicate record
DRAPBBXA3
|
Sample output file should be ....
--------------------------------
Code: |
Header:
---------
AX00 20070804025000RAMTX00056790 00000000041357
Detail records:
-----------------
DRAPBBXA0
DRAPBBXA1
DRAPBBXA2
DRAPBBXA3
|
* One duplicate record(DRAPBBXA2) from the i/p file removed and the
header count is updated from 5 to 4. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Since the input file is VB, we need to add 4 bytes (for the RDW) to your starting positions. I assumed that the header record can be identified by the 'A' in position 1.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
SORT FIELDS=(5,13,CH,A)
SUM FIELDS=NONE
OUTFIL FNAMES=T1
OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,VTOF,
BUILD=(80X),
TRAILER1=('NEWCT,''',COUNT-1=(M11,LENGTH=4),C'''')
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(5,1,CH,EQ,C'A'),
OVERLAY=(63:NEWCT))
/*
|
|
|
Back to top |
|
|
Nanda Krishna
New User
Joined: 30 Nov 2005 Posts: 19 Location: Bangalore
|
|
|
|
Hi Frank,
Thanks for the DFSORT job. It is working as per expectations. But, when i am checking for syntax errors, i am getting the following error msg...(but the job ended with rc 00). Could you explain why it is so? Thanks for your time.
Sev Msg No. Message Text
-----------------------------------------------------
E1 8 DSS10065E Parameter 'COUNT-1' is unidentified. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Huh? Checking for syntax errors how? If you received a DFSORT syntax error, it would be an ICExxxA message and you would not get RC=0.
Quote: |
E1 8 DSS10065E Parameter 'COUNT-1' is unidentified. |
This message is NOT from DFSORT. What program are you running that produces this error message? |
|
Back to top |
|
|
|