View previous topic :: View next topic
|
Author |
Message |
rsshanmugam
New User
Joined: 08 Mar 2005 Posts: 62 Location: Basildon
|
|
|
|
Hi,
i want to write a trailer record for a file using DFSORT,
the trailer record format is first six bytes should have 999999 , it should be followed by 7 bytes of record count of detail records amd 472 byte it should have 0.
the length of the file is 472.
can anybody please give me the solution for this problem
the format is given below
XXXX-TRLR-IND 6/NUM 999999
XXXX-NO-OF-REC 7/NUM 0000177
FILLER 15/AN
FILLER 471/AN
(POS 41-80)
(POS 81-120)
(POS 121-160)
(POS 161-200)
(POS 201-240)
(POS 241-280)
(POS 281-320)
(POS 321-360)
(POS 361-400)
(POS 401-440)
(POS 441-471)
XXXX-TRLR-EOR 1/AN 0
it is damn urgent.
the following is my data record,.
MMMM000000005000000000M4 ABDULLAH HARBI
MMMM077000011000000000M4
MMRC000000001J06 20060801
MMMM000000001000000001M4 HOLIATY EXH. , RIYADH
MMSM000000001000000001000000001HOLIATY EXH. , RIYADH RIYADH
MMSM000011102000000001000000001RIYADH
MMSM000011130000000001000000001SAMBA
MMMM000000003000000001M4 ASDA FOODS, RIYADH
MMSM000000004000000003000000001ASDA FOODS. , RIYADH
MMMM000000077000000001M4
MMMM000011036000000001M4 MOHAMMAD A JARB
MMSM000011036000011036000000001MOHAMMAD A JARB, RIYADH RIYADH
MMMM023232323000000001M4 SAMBA TEST
MMSM232323232023232323000000001SAMBA TEST
MMMM999999998000000001M4 DEFAULT STORE
MMSM999999998999999998000000001DEFAULT
MMRC000000002J06 20060803
MMMM000000002000000002M4 ABC CAR RENTALS. , RIYADH
MMSM000000002000000002000000002ABC CAR RENTALS. , RIYADH
MMSM000000003000000002000000002ABC CAR RENTALS. , RIYADH
MMRC000000003SM9 20060809
MMMM000011035000000003M4 KHAN TRAVELS
|
|
Back to top |
|
|
ramesh_m
New User
Joined: 27 Sep 2006 Posts: 10 Location: Sydney
|
|
|
|
Hi Shanmugam,
Hope this will help
INCLUDE COND=(1,2,CH,EQ,C'MM')
SORT FIELDS=COPY
OUTREC FIELDS=(1,472,SEQNUM,7,ZD,START=1)
OUTREC=(1,472)
OUTFILE FNAMES=SORTF1
TRAILER1=(1:'999999',
7:473,7) |
|
Back to top |
|
|
rsshanmugam
New User
Joined: 08 Mar 2005 Posts: 62 Location: Basildon
|
|
|
|
Hi ramesh_m,
how does the record count is managed can you please explain me.
thaks for your efforts
thanks and regards,
shanmugam. |
|
Back to top |
|
|
ramesh_m
New User
Joined: 27 Sep 2006 Posts: 10 Location: Sydney
|
|
|
|
SEQNUM is a varriable for counting the detail records when copying. It occupied position 473 to 479 temporarily.
When copying it will accumulate following way
0000001
0000002
---------
--------- |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sigh. You don't need to use a SEQNUM to get the record count. DFSORT has a COUNT function for that. Here's the DFSORT control statements that will give you what you asked for:
Code: |
OPTION COPY
OUTFIL REMOVECC,
TRAILER1=('999999',COUNT=(M11,LENGTH=7),472:'0')
|
|
|
Back to top |
|
|
rsshanmugam
New User
Joined: 08 Mar 2005 Posts: 62 Location: Basildon
|
|
|
|
HI Yager,
Thanks for your reply, i tried the same thing it works really wonderfull. |
|
Back to top |
|
|
|