Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating HOLD-FILES 1

Status
Not open for further replies.

railai

Programmer
Jun 2, 2006
1
DE
Hello,

I have 3 identical HOLD-Files with different colum-names. For example a partner-table with the columns "partnername" (A20) and "start" (date), a customer table the columns "customername" (A20) and "beginn" (date) ...

I want to concatenate this hold files for the further processing like this:

Print NAME
by DATE

Do you have an idea to do this ?
Thank you

 
The easiest way to do this is with 'Universal Concatenation', using the MORE command.

First, issue DEFINEs for two of the three files, so all the files have the SAME fieldnames available.

Then, issue your first TABLE request, and, instead of ending with 'END', use 'MORE'. Then issue the second filename ('FILE filename'), and again say 'MORE'. Repeat with the third file, but this time say 'END'. The result will be your first request will be applied to your second and third files, as well (that's why you needed the DEFINEs, to have the same fieldnames), and the output will be concatenated into the 'iternal matrix', from which your report will be produced.
 
Hello,

Using the "MORE" worked great at putting together two hold files, but does any one know how I would be able to hold the output data so that I can work with it. I tried using a "on table hold as <filename>" but it would produce an error. Anyone have any ideas? Thanks.
 
HOLDing the output of MORE should work. I can only guess you put the HOLD someplace other than the first request component. Here's sample code that worked for me:

Code:
 TABLE FILE CAR                    
 PRINT COUNTRY                     
 IF COUNTRY EQ 'ENGLAND' OR 'JAPAN'
 ON TABLE HOLD AS MOREOUT          
 MORE                              
 FILE CAR                          
 IF COUNTRY EQ 'W GERMANY'         
 END                               
 TABLE FILE MOREOUT                
 PRINT *                           
 END

I tried this in WebFocus 7.1.3, and it produced an output with all 3 countries. Note that the HOLD is in the FIRST part of the request.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top