Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Writing Trailer record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 54
Location: Chennai

PostPosted: Thu Sep 28, 2006 11:31 am    Post subject: Writing Trailer record
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    Post subject:
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: 54
Location: Chennai

PostPosted: Thu Sep 28, 2006 2:55 pm    Post subject: Re: Writing Trailer record
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    Post subject:
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 Moderator


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

PostPosted: Thu Sep 28, 2006 8:41 pm    Post subject:
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: 54
Location: Chennai

PostPosted: Sat Sep 30, 2006 11:14 am    Post subject: Re: Writing Trailer record
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us