Focal Point
[CLOSED] Copy/Append of hold files

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/439109824

April 27, 2010, 10:07 AM
Malinda
[CLOSED] Copy/Append of hold files
In mainframe focus, you can create several hold files and then do a copy hold1.ftm to print file and append hold2.ftm to the same print file. How do I do that with WebFocus?

Thanks,
Malinda

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 10:15 AM
Dave
Not really an answer to that, but a possible 'workaround'.

If the contents of the holdfiles are the same you could use MORE to make the two holdfiles into one. And then copy to print file.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
April 27, 2010, 10:19 AM
GamP
Don't know exactly what you mean with 'print file'. That is not really a concept very well known on windows machines.
But appending to a hold file can be done by means of the filedef statement:
FILEDEF ddname DISK filename.ftm (APPEND
will do the trick. Be sure you point the filedef to the right logical (ddname) and physical filename.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 27, 2010, 10:42 AM
Malinda
Print file - my final output file Smiler That is just our wordage from mainframe.

Dave - the contents are pretty much the same, am using the same/similar columns. Where would I put this in my code?

GamP - using FileDef, where would this go in the code, after both hold files are created? And if so, ddname would be my first hold file?

malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 10:43 AM
Francis Mariani
Malinda,

Let us know what you would like to do - there are several options:




Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 27, 2010, 10:50 AM
Malinda
I guess I don't know which is my best options. I have already created my 2 hold files. Hold 1 contains the stu id, site id, and the role. hold 2 contains the instructor id, site id and role.

I can do a join on my hold files and create my final file that way but was wondering of a better way or recommendations since my training and knowledge is fairly limited.

I would say probably either MORE or FILEDEF?

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 10:59 AM
Francis Mariani
If the number of columns, format and names of columns are exactly the same in the two HOLD files, MORE is the best choice. FILEDEF would also work.

But since you have different data in the two files, JOIN or MATCH are the two possibilities.

This does not seem to be the scenario you described in your opening post - "In mainframe focus, you can create several hold files and then do a copy hold1.ftm to print file and append hold2.ftm to the same print file"


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 27, 2010, 11:09 AM
Malinda
I can easily make the student id and instructor id columns have the same names, this would then make it so I could use the more.

Where does the MORE command fit it my code?

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 11:17 AM
njsden
From documentation:

{TABLE|MATCH}  FILE file1 
   main request 
MORE
FILE file2 
  subrequest 
MORE
FILE file3 
  subrequest 
MORE
   .
   .
   .
{END|RUN}


So you could do:

TABLE FILE STUDENTS
PRINT NAME
BY ID
MORE 
FILE TEACHERS
END




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
April 27, 2010, 11:18 AM
GinnyJakes
MORE has a couple of restrictions so definitely look at the documentation but here is a pseudo-code example:
TABLE FILE HOLD1
PRINT whatever
BY otherstuff
ON TABLE HOLD AS xxxxxxx FORMAT yyyyyyyy
MORE
FILE HOLD2
END

This assumes the column names in both files are the same. If not, use a DEFINE or AS name when generating the file to homogenize the names.

The output options always go in the first request.

The only thing that can go in the subreqeusts is a WHERE or IF statement.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
April 27, 2010, 11:27 AM
njsden
quote:
I guess I don't know which is my best options. I have already created my 2 hold files. Hold 1 contains the stu id, site id, and the role. hold 2 contains the instructor id, site id and role.


The approach you use depends on what you what to achieve with your report.

If you just want a list of "people" at school with no relationship among them then concatenating the sources would help (via MORE or FILEDEF). You would get something like:

ID  NAME               ROLE
--- ---------------    ---------
100 FOX, MEGAN         STUDENT
110 ROBERTS, JULIA     STUDENT
120 WINSLET, KATE      STUDENT
.
.
500 CAMERON, JAMES     TEACHER
510 SPIELBERG, STEVEN  TEACHER
.
.


Now, if what you need is a list of Students grouped by Teacher, then concatenation is *not* going to help. You'll need to JOIN both structures and then do the report so you could get:

TEACHER_ID  TEACHER_NAME       STUDENT_ID  STUDENT_NAME
----------  ------------------ ----------- --------------
500         CAMERON, JAMES     110         ROBERTS, JULIA
                               120         WINSLET, KATE
                               .
                               .
510         SPIELBERG, STEVEN  100         FOX, MEGAN
                               .
                               .




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
April 27, 2010, 11:33 AM
Malinda
Thanks, guys. I will try to MORE and see what I get Smiler

malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 12:34 PM
PBrightwell
quote:
Print file - my final output file


Are you wanting to put two data files together or two reports together?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 27, 2010, 01:51 PM
Malinda
I am actually trying to put 2 hold files together.

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
April 27, 2010, 02:52 PM
GamP
It depends a bit on what the ultimate purpose of the concatenated file is.

If you trying to put together two identically layed out reports from different sources:
FILEDEF RESULT DISK RESULT.FTM (APPEND
TABLE FILE ONE
PRINT ....
ON TABLE HOLD AS RESULT
END
TABLE FILE TWO
PRINT ...
ON TABLE HOLD AS RESULT
END

This will put the result from both requests in the same file.
You can further process the final file with the result master file, which is created by the second request.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988