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
 

 

Trailer count addition

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

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Thu Mar 13, 2008 1:15 am    Post subject: Trailer count addition
Reply with quote

Hi,

the two files need to be merged with the trailer totals added
File 1:
h
r1
r2
r3
t1 001 002 003
t2 004 005 006

File 2:
h
r4
r5
r6
t1 007 008 009
t2 001 002 003

o/p:
h
r1
r2
r3
r4
r5
r6
t1 008 010 012
t2 005 007 009
Back to top
View user's profile Send private message

ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Thu Mar 13, 2008 1:19 am    Post subject:
Reply with quote

Sorry i have missed out,each field in trailer that needs to be summed has decimal 5 digits.

file:

h
r1
r2
r3
t1 001.12345 002.56789 003.12987
t2 005.12345 006.12987 008.56789
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 Mar 13, 2008 2:42 am    Post subject:
Reply with quote

Please show a correct example for input file1, input file2 and the output file.

What is the RECFM and LRECL of the input files?

When you say "merged", do you actually mean that the output file should have records "merged" by a key, or do you just mean that the output file should have the file1 records followed by the file2 records?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Thu Mar 13, 2008 9:35 am    Post subject:
Reply with quote

the file is 100 byte with FB.

the output file will have the file1 records followed by the file2 records with one header and two trailer with the summation of the trailer values
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 Mar 13, 2008 8:51 pm    Post subject:
Reply with quote

When you give me all of the information I asked for in my previous post, then I'll give you a solution.
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Thu Mar 13, 2008 10:25 pm    Post subject:
Reply with quote

sorry for not posting the complete information
the file is 100 byte with FB.

File 1:
h
r1
r2
r3
t1 001.11111 002.22222 003.33333
t2 004.22222 005.55555 006.66666

File 2:
h
r4
r5
r6
t1 007.77777 008.55555 009.55555
t2 001.66666 002.33333 003.11111

o/p:
h
r1
r2
r3
r4
r5
r6
t1 008.88888 010.77777 012.88888
t2 005.88888 007.88888 009.77777
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 Mar 13, 2008 10:27 pm    Post subject:
Reply with quote

You still haven't posted the complete information:

When you say "merged", do you actually mean that the output file should have records "merged" by a key, or do you just mean that the output file should have the file1 records followed by the file2 records?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Fri Mar 14, 2008 12:26 am    Post subject:
Reply with quote

the output file should have the file1 records followed by the file2 records.
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: Fri Mar 14, 2008 2:46 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (FB/100)
//       DD DSN=...  input file2 (FB/100)
//SORTOUT DD DSN=...  output file (FB/100)
//SYSIN    DD    *
  OPTION EQUALS,SKIPREC=1
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(101:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'h'),OVERLAY=(101:C'00000000')),
    IFTHEN=(WHEN=(1,2,CH,EQ,C't1'),
      OVERLAY=(4:4,9,UFF,TO=ZD,LENGTH=9,
              15:15,9,UFF,TO=ZD,LENGTH=9,
              26:26,9,UFF,TO=ZD,LENGTH=9,
              101:C'99999998')),
    IFTHEN=(WHEN=(1,2,CH,EQ,C't2'),
      OVERLAY=(4:4,9,UFF,TO=ZD,LENGTH=9,
              15:15,9,UFF,TO=ZD,LENGTH=9,
              26:26,9,UFF,TO=ZD,LENGTH=9,
              101:C'99999999'))
  SORT FIELDS=(101,8,ZD,A)
  SUM FORMAT=ZD,FIELDS=(4,9,15,9,26,9)
  OUTREC IFOUTLEN=100,
    IFTHEN=(WHEN=(1,2,SS,EQ,C't1,t2'),
      OVERLAY=(4:4,9,ZD,EDIT=(TTT.TTTTT),
              15:15,9,ZD,EDIT=(TTT.TTTTT),
              26:26,9,ZD,EDIT=(TTT.TTTTT)))
/*
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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 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 abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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