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

Two files to merge and to update trailer count


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jun 30, 2011 8:20 pm
Reply with quote

Here's another way of doing it.
Code:
//SYSIN    DD *                                                     
  INREC IFTHEN=(WHEN=INIT,                                           
                OVERLAY=(1028:SEQNUM,8,ZD,9C'0')),                   
        IFTHEN=(WHEN=(1,10,CH,EQ,C'0000000000'),                     
                OVERLAY=(1028:17C'0')),                             
        IFTHEN=(WHEN=(1,10,CH,EQ,C'9999999999'),                     
                OVERLAY=(1028:8C'9',11,9))                           
  SORT FIELDS=(1028,8,CH,A)                                         
  SUM FIELDS=(1036,9,ZD)                                             
  OUTREC IFOUTLEN=1027,                                             
         IFTHEN=(WHEN=(1,10,CH,EQ,C'9999999999'),OVERLAY=(11:1036,9))
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jul 01, 2011 8:44 am
Reply with quote

Hi,

the only thing I don't agree with some of the solutions is why do we need to sort the files if it can be avoided, especially if the files happen to be large.


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jul 01, 2011 9:46 am
Reply with quote

Hi Gerry,

I agree to your point that if the data volume is huge, it's better to avoid a SUM.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 02, 2011 4:05 am
Reply with quote

sunil.maaraka wrote:
[...]
OUTFIL REMOVECC,BUILD=(1,1027),OMIT=(1028,10,ZD,GT,+1,AND, 1,10,CH,EQ,C'0000000000'),

[...]


1028,10,ZD is the record sequence number that has been generated by the control card. If it is greater than one, and the record is a header, omit it. Thus any and all header records which are not the first record that was read will be excluded. The first record, if it is a header, will be used to create the output header.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top