IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Writing Trailer record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Thu Sep 28, 2006 11:31 am
Reply with quote

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
View user's profile Send private message
ramesh_m

New User


Joined: 27 Sep 2006
Posts: 10
Location: Sydney

PostPosted: Thu Sep 28, 2006 2:03 pm
Reply with quote

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
View user's profile Send private message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Thu Sep 28, 2006 2:55 pm
Reply with quote

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
View user's profile Send private message
ramesh_m

New User


Joined: 27 Sep 2006
Posts: 10
Location: Sydney

PostPosted: Thu Sep 28, 2006 3:25 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 28, 2006 8:41 pm
Reply with quote

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
View user's profile Send private message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Sat Sep 30, 2006 11:14 am
Reply with quote

HI Yager,

Thanks for your reply, i tried the same thing it works really wonderfull.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top