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
 

 

Want to merge the records of the 2 files

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

New User


Joined: 16 Dec 2003
Posts: 3
Location: India

PostPosted: Mon Apr 19, 2004 4:10 pm    Post subject: Want to merge the records of the 2 files
Reply with quote

I am having 2 flat files A & B with size as 25 & 35 respectively. I want to merge the records of the 2 files in such a way that Record 1 of file A + Record 1 of file B giving a total size of 60 for every record.[/b]
Back to top
View user's profile Send private message

bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Mon Apr 19, 2004 4:14 pm    Post subject:
Reply with quote

Do u have documentation on icetool ?
I believe icetool can help u there ...
if u need this doc, I have it pdf format, post a msg there with your mail address and I'll try to send it.
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Mon Apr 19, 2004 4:18 pm    Post subject:
Reply with quote

I won't send it here is the link to the PDF icetool miniuserguide paper :
http://www.storage.ibm.com/software/sort/mvs/uq90053/pdf/sortpaug.pdf
read on the splice operator section
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Mon Apr 19, 2004 4:33 pm    Post subject:
Reply with quote

Hello man_pat,

Page no 13 of the above manual contains the solution you are looking for.

Hope this helps

Regards
Mayuresh Tendulkar
Back to top
View user's profile Send private message
mvs_butta

New User


Joined: 23 Dec 2003
Posts: 13

PostPosted: Mon Apr 19, 2004 9:59 pm    Post subject:
Reply with quote

check this link

http://www.storage.ibm.com/software/sort/mvs/tricks/srtmst02.html#t3a
Back to top
View user's profile Send private message
man_pat

New User


Joined: 16 Dec 2003
Posts: 3
Location: India

PostPosted: Tue Apr 20, 2004 7:18 am    Post subject: Combining 2 files
Reply with quote

Thanks for the useful info.

Can I do it without using ICETOOL??
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Apr 20, 2004 12:28 pm    Post subject:
Reply with quote

can u do it wihout icetool (standard IBM utility) ?

YYYESS !!!

thing is u'll need to know about programming languages like cobol...
or REXX (a little bit easier than grumpy COBOL).

is this the way u wanna go ?
Back to top
View user's profile Send private message
man_pat

New User


Joined: 16 Dec 2003
Posts: 3
Location: India

PostPosted: Tue Apr 20, 2004 12:44 pm    Post subject: Combining 2 files
Reply with quote

Yes... programetically with out using any utility directly
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Apr 20, 2004 4:18 pm    Post subject:
Reply with quote

Quote:

I am having 2 flat files A & B with size as 25 & 35 respectively. I want to merge the records of the 2 files in such a way that Record 1 of file A + Record 1 of file B giving a total size of 60 for every record

so basically you want to merge to file vertically ?
as I said you can do this using either cobol or more directly REXX.

DO U EXPECT US to GIVE u SOME CODE ?
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Apr 20, 2004 4:32 pm    Post subject:
Reply with quote

here is some rexx code that do what u want. but note that

  • combi01 should be the bigger file allocated
  • if you want to relieve from this situation you'll have to modify the present code
  • there is some sort (utility) statement that may help u to achieve this. (I've not look into the matter) .
  • you still need to code your file name (your-file1 and yourfile2

anyway here goes
Code:


/* REXX */                                               
"delete '"userid()".exo.combo'"                         
"alloc fi(combi01) da('your-file1') shr reuse"     
"alloc fi(combi02) da('your-file2') shr reuse"     
 "alloc fi(combo) dataset('"userid()".exo.combo') new catalog",
 "SPACE(2,1) CYL RECFM(F B) BLKSIZE(27960) LRECL(80)"   
"execio * diskr combi01 (stem combi01. finis"           
"execio * diskr combi02 (stem combi02. finis"           
queue substr(combi01.1,1,25) !!substr(combi02.1,1,35)   
cb2c=combi02.0                                           
cb1c=combi01.0                                           
select                                                   
when cb1c> cb2c then call cb1c_bigger                   
when cb2C> cb1c then call cb2c_bigger                   
when cb2c=cb1c then call even_process                   
otherwise call error_process                             
end                                                     
"execio " queued() " diskW combo (finis "               

 "free fi(combi01 combi02 combo)"                             
 say 'bye bye '                                               
 exit 1                                                       
 cB1c_bigger:     
/* combi01 is bigger */                                           
 "execio * diskr combi01 (stem combi01. finis"                 
 do I=2 to combi01.0                                           
  if I>cb2c then queue substr(combi01.i,1,25)                 
   else do                                                     
          if i=2 then sk=i                                     
               else  sk=i-1                                   
            "execio 1 diskr combi02 (stem combi02."               
      queue substr(combi01.i,1,25) !!substr(combi02.i,1,35)   
          end                                                 
 end     
"execio 0 diskr combi02 (finis"                                                     
 return         
  even_process:       
/* same number of records */                                             
"execio * diskr combi01 (stem combi01. finis"                     
"execio * diskr combi02 (stem combi02. finis"                     
do I=2 to combi01.0                                               
 queue substr(combi01.i,1,25) !!substr(combi02.i,1,35)           
 end                                                             
end                                                               
Error_process:                                                   
say 'error ' sourceline(sigl)                                     
say ' * ' sigl                                                   
exit 2                                                           


as you can see from the code, if u have combi02 allocated as bigger file it will fail (no sub-routine included).
It is up to u to do it.
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
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
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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