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
 

 

Sort with including Trailer records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Sort with including Trailer records
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: 2150
Location: At my coffee table

PostPosted: Thu May 22, 2008 1:16 pm    Post subject:
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    Post subject: Sort with including Trailer records
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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