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

SORT to count header and trailer


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krunal7757

New User


Joined: 01 Sep 2021
Posts: 6
Location: INdia

PostPosted: Mon Sep 20, 2021 10:11 pm
Reply with quote

Infile 1
Code:
000000000001H                      09092021
000000000001XA11000010000000010000009092021 09082021 TESTDATA1
000000000001XB11000010100000020000009092021 09082021 TESTDATE2


Infile 2

Code:
000000000002H                      09092021
000000000002XC11000010000000010000009092021 09082021 TESTDATA1
000000000002XD11000010100000020000009092021 09082021 TESTDATE2

Both file have first record as header and other records are detials of cancel chq.
first 12 bytes are id number followed by record identifier

I need to merge the file to create one file having one trailer count but trailer count should not include the count of header records.

sort card i used: but it count the header record too resulting in incorrect data. Can you please help on this
Code:
***************************** Top of Data ********
   SORT FIELDS=(1,12,CH,A)
   OUTFIL FNAMES=SORTOUT,
        REMOVECC,
        TRAILER1=(1:12X,13:'T',
        14:COUNT=(M11,LENGTH=10),
        24:TOT=(24,12,ZD,TO=ZD,LENGTH=12),115X)

Coded for you
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Sep 20, 2021 10:19 pm
Reply with quote

1) Make a search on this forum. Exactly this question has been answered approx. 1500 times.

2) Before posting, read the Forum Rules, and especially: how to use code tags when posting any code samples

3) Please, read carefully about the difference between JOIN, MERGE, and SORT operations. Which one do you really need? It is not clear from your post...

4) from your post it is also unclear: what output result do you expect? And what have you received with your code?


Unless you present enough information about your issue, there are not too many volunteers to do your own job instead of yourself.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Mon Sep 20, 2021 11:47 pm
Reply with quote

Seriously, these cross postings to wrong sections of the forums have to stop. WTH does this have to do with Java & MQSeries?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Sep 21, 2021 7:50 am
Reply with quote

Moved to Students Section.

Please learn to use code tags and SEARCH the forum first before posting any questions.
E.g. ibmmainframes.com/about64587.html
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Wed Sep 22, 2021 7:37 pm
Reply with quote

Make for ex a separate counter when you don't have Header records, using SEQNUM. Use that field in TRAILER1.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Sep 22, 2021 7:51 pm
Reply with quote

Joerg.Findeisen wrote:
Make for ex a separate counter when you don't have Header records, using SEQNUM. Use that field in TRAILER1.

None of us (including the TS) has any initial idea: what to do with two input datasets? The only SORT statement would not help...
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top