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

Sort with including Trailer records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Thu May 22, 2008 11:49 am
Reply with quote

I have two files, the last record is Trailer Record.
Please note that my files also contain UHDR and UTRL.
The trailer record has three count at positions 16, 26 and 36.
Each count is declare as Z(8)9 inside the program.
i need to add the counts at corresponding positons and place it in another
file. Another thing is the new file should contain TRAILER RECORD starting from positon 1 to 14.

i used a control card as follows,

SORT FIELDS=COPY
INCLUDE COND=(01,07,CH,EQ,C'TRAILER')
SUM FIELDS=(16,9,26,9,36,9), FORMAT=ZD

This didnt work. Please help me on this.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 22, 2008 1:16 pm
Reply with quote

Please post your sysins and all your sysouts....
Please post an example of your input and the 'expected' output....
Back to top
View user's profile Send private message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Thu May 22, 2008 7:47 pm
Reply with quote

Input File1:
189899195021B61L91460 03836W1031602 8Z 6712WTR
189899195021B61L91461 03836W1031602 8Z 6712WTR
189899657072G31I63195 1110131081602 8Z 0000BSY
TRAILER RECORD 1 1 1

Input File2:
18989979131LU81L91462 74347R5861601 8Z 6714DUG
28989979131LU81L91462 PROSHARES TRUST
TRAILER RECORD 1 1 0

Sort Cord Used:
INCLUDE COND=(01,07,CH,EQ,C'TRAILER')
SORT FIELDS=(1,14,CH,A)
SUM FIELDS=(16,9,ZD,26,9,ZD,36,9,ZD)

Note:
1.The trailer record is populated via three counters TL-T1COUNT, TL-T2COUNT and TL-T3COUNT respectively.

2.TL-T1COUNT, TL-T2COUNT and TL-T1COUNT fields are declared as Z(8)9
inside the cobol program.
Hence I used ZD.

This worked fine and got an output as below:
Actual Output:
TRAILER RECORD 000000002 000000002 000000001

Now my need is to suppress the padded zeros. Please Help me on this.
Desired Output:
TRAILER RECORD 2 2 1
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 22, 2008 9:13 pm
Reply with quote

Ilakkia,


Try the following DFSORT control cards

Code:

//SYSIN    DD *                             
  INCLUDE COND=(1,7,CH,EQ,C'TRAILER')       
  SORT FIELDS=COPY                           
  OUTFIL REMOVECC,NODETAIL,                 
  TRAILER1=('TRAILER RECORD',               
            16:TOT=(16,09,ZD,M10,LENGTH=9), 
            26:TOT=(26,09,ZD,M10,LENGTH=9), 
            36:TOT=(36,09,ZD,M10,LENGTH=9)) 
/*                                         
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top