Focal Point
[SOLVED] Saving HOLD File to My Machine

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

October 03, 2019, 02:01 PM
AMC2
[SOLVED] Saving HOLD File to My Machine
This below is not saving to my machine. Any thoughts?


ON TABLE SAVE FILENAME 'C:\ibi\ACSGROUP_SHP' FORMAT ALPHA

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 02:08 PM
pav
Hello,

Did you use FILEDEF?

Thank You.
October 03, 2019, 02:16 PM
AMC2
Ah thanks...I forgot my FILEDEF. I have to FILEDEF it to the same location.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 02:29 PM
AMC2
How should my FILEDEF look?


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 02:43 PM
pav
Something like this....

 
FILEDEF TEST DISK "C:\...\...\...\...TEST.PDF"

TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS TEST FORMAT PDF
END
-RUN

October 03, 2019, 03:19 PM
AMC2
So I used ON TABLE HOLD and ON TABLE SAVE and I pretty much get this but no file on my machine:

Possible causes:
- Output was directed to a destination such as a file or printer

0 NUMBER OF RECORDS IN TABLE= 40479 LINES= 40479
-EXIT


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 03:41 PM
BabakNYC
https://webfocusinfocenter.inf...ang/source/out96.htm


WebFOCUS 8206, Unix, Windows
October 03, 2019, 03:49 PM
FP Mod Chuck
ON TABLE HOLD and ON TABLE SAVE will save the results back to the machine where the reporting server is installed. ON TABLE PCHOLD will attempt to save to your local machine. No FILEDEF required.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 03, 2019, 04:23 PM
AMC2
None of this is generating the file on my local machine:

  
-SET &ECHO = ALL;

APP MAP holdapp /C:/ibi
APP HOLDDATA holdapp
APP HOLDMETA holdapp

-*FILEDEF ACSGROUP  DISK "C:\ibi\ACSGROUP.ALPHA"
FILEDEF ACSGROUP DIR \C:\ibi\ACSGROUP.ALPHA
-*FILEDEF ACSGROUP  DISK \\C:\ibi\ACSGROUP.ALPHA


DEFINE FILE SV_SHIPMENTS
SHIPDATE_YR/YY = SHIPDATE;
DELIVERY_DATE_YR/YY = DELIVERY_DATE;
BILL_DATE_YR/YY = BILL_DATE;
SELECT_YR/A3 = IF (SHIPDATE_YR EQ '2019' OR DELIVERY_DATE_YR EQ '2019' OR BILL_DATE_YR EQ '2019') 
                 THEN 'YES' ELSE 'NOP';
CURR_USER/A100V=UPPER(REPLACE('jsutton', 'hills\', ''));
END

TABLE FILE SV_SHIPMENTS
PRINT *
-*      SHIPDATE
-*      SHIPDATE_YR
-*      DELIVERY_DATE_YR
-*	    BILL_DATE_YR
BY MASTER_CLIENT_NAME NOPRINT
WHERE MASTER_CLIENT_NAME EQ 'ACS GROUP';
WHERE SELECT_YR EQ 'YES';
WHERE SV_SHIPMENTS.SV_SHIPMENTS.LOGIN_ID EQ CURR_USER
-*WHERE RECORDLIMIT EQ 10
-*ON TABLE PCHOLD FILENAME 'C:\ibi\ACSGROUP' FORMAT ALPHA
-*ON TABLE SAVE AS 'C:\ibi\ACSGROUP' FORMAT ALPHA
ON TABLE HOLD AS ACSGROUP FORMAT ALPHA
END
-RUN
-EXIT
 





WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 04:35 PM
FP Mod Chuck
AMC2

I tried this on my machine and even though I tried to name the file it downloads a file wfservlet.ibfs. The first time I associated the ibfs file type with textpad so it would open it the next time. By default it stores it in the download folder on my machine. It's not perfect but it will get you the file on your machine.

I just have ON TABLE PCHOLD FORMAT ALPHA


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 03, 2019, 05:35 PM
AMC2
Chuck - Ok this works on my machine as you say too. Right, not perfect but it gets the file on my machine in alpha format. Thanks.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 03, 2019, 07:13 PM
FP Mod Chuck
AMC2

One other option is to use ON TABLE PCHOLD FORMAT WP
The output will come up in a browser where you can copy and paste into textpad and save the file.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 04, 2019, 10:50 AM
AMC2
Chuck - Thanks for this format as well. The data generates wrapped using both ways...the column headings and the field values are wrapped at a certain point.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 04, 2019, 11:34 AM
FP Mod Chuck
Hmmmmmm, I do not experience any data wrapping with either method and each line is over 500 characters.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 04, 2019, 12:02 PM
AMC2
Here's how the column headings are coming out for me below. The field values are coming out the same way.

LOGIN_ID PRIMARY_ID RECTYPE MASTER_CLIENT_NAME CUSTOMER_ID CUSTOMER_NAME CARRIER_ID CARRIER_NAME SHIPMENT_ID MOVEMENT_ID MANIFEST_ID LINESEQ INVREV INVTYPE SOURCE_ID SHARED_RECORD PRIMARY_RECORD INVOICING_CARRIER PRO_NUMBER BILL_OF_LADING BRANCH_ID BRANCH REVENUE_ALLOCATION MODE ORDER_TYPE SCHED_SHIP_EARLY SCHED_SHIP_LATE SHIPDATE SCHED_DELIVER_EARLY SCHED_DELIVER_LATE DELIVERY_DATE SHIPMENT_STATUS MOVEMENT_STATUS BROKERAGE_STATUS WEIGHT WEIGHT_UOM ORIGIN_ID SHIPPER ORIGIN_ADDRESS1 ORIGIN_ADDRESS2 ORIGIN_CITY ORIGIN_STATE ORIGIN_ZIP ORIGIN_CBSA_CODE ORIGIN_CBSA_TITLE ORIGIN_REGION ORIGIN_COUNTRY DESTINATION_ID RECEIVER DESTINATION_ADDRESS1 DESTINATION_ADDRESS2 DESTINATION_CITY DESTINATION_STATE DESTINATION_ZIP DESTINATION_CBSA_CODE DESTINATION_CBSA_TITLE DESTINATION_REGION DESTINATION_COUNTRY CHARGE_FREIGHT CHARGE_FUEL CHARGE_OTHER CHARGE_TOTAL EXPENSE_FREIGHT EXPENSE_FUEL EXPENSE_OTHER EXPENSE_TOTAL TOTAL_PICKUPS TOTAL_DELIVERIES TOTAL_STOPS SERVICE_FAIL_PICKUP SERVICE_FAIL_DELIVERY SERVICE_FAIL_TOTAL DISTANCE CONTRACT_TYPE TRACK_COMPLIANCE COMPLIANT_SHIPMENT COMPLIANT_PAID_AMT COMPLIANT_CARRIER_PAY_AMT COMPLIANT_LOW_COST_CHARGE COMPLIANT_LOW_COST_CARRIER_PAY COMPLIANT_OVERPAY_AMOUNT COMPLIANT_SCAC COMPLIANT_CARRIER EQUIPMENT_TYPE EQUIPMENT_GROUP BILL_DATE PROCESS_BATCH_ID PROCESS_BATCH_DATE REVIEWSTATUS CUSTOMER_APPROVED_AMOUNT CUSTOMER_APPROVED_BATCH_ID CUSTOMER_FUNDED_AMOUNT CUSTOMER_FUNDED_DATE CARRIER_PAY_AMOUNT CARRIER_PAY_DATE CARRIER_PAY_BATCH_ID TRACK_BENCHMARK_SAVINGS BENCHMARK_PAID_AMT BENCHMARK_USED_CARRIER_AMT BENCHMARK_AMT BENCHMARK_SAVINGS_AMT BENCHMARK_SCAC CSR_ID_ORDER CSR_NAME_ORDER CSR_DEPARTMENT_ID_ORDER CSR_DEPARTMENT_NAME_ORDER CLASS_WEIGHT_PAIRS CHARGEITEM_COST_PAIRS REFERENCES PURPOSE DIRECTION ENTERED_BY_USER_ID ENTERED_BY_USER_NAME ENTERED_BY_DEPARTMENT_ID ENTERED_BY_DEPARTMENT_DESCR ENTERED_ON TRACKING_URL COMMODITY TRAILER_NUM LOGISTICAL_LABS_ID LOGISTICAL_LABS_ENTRD_DT LOGISTICAL_LABS_CARR_RATE PRE_AUDIT_VERIFIED CARR_INVOICE_AMT


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 04, 2019, 12:09 PM
FP Mod Chuck
AMC2

Please post your entire fex.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 04, 2019, 12:30 PM
AMC2
 

-*FILEDEF ACSGROUP  DISK "C:\ibi\ACSGROUP.ALPHA"
FILEDEF ACSGROUP DIR \C:\ibi\ACSGROUP.ALPHA
-*FILEDEF ACSGROUP  DISK \\C:\ibi\ACSGROUP.ALPHA


DEFINE FILE SV_SHIPMENTS
SHIPDATE_YR/YY = SHIPDATE;
DELIVERY_DATE_YR/YY = DELIVERY_DATE;
BILL_DATE_YR/YY = BILL_DATE;
SELECT_YR/A3 = IF (SHIPDATE_YR EQ '2019' OR DELIVERY_DATE_YR EQ '2019' OR BILL_DATE_YR EQ '2019')
                 THEN 'YES' ELSE 'NOP';
CURR_USER/A100V=UPPER(REPLACE('jsutton', 'hills\', ''));
END

TABLE FILE SV_SHIPMENTS
PRINT *
-*      SHIPDATE
-*      SHIPDATE_YR
-*      DELIVERY_DATE_YR
-*	    BILL_DATE_YR
BY MASTER_CLIENT_NAME NOPRINT
WHERE MASTER_CLIENT_NAME EQ 'ACS GROUP';
WHERE SELECT_YR EQ 'YES';
WHERE SV_SHIPMENTS.SV_SHIPMENTS.LOGIN_ID EQ CURR_USER
-*WHERE RECORDLIMIT EQ 10
-*ON TABLE PCHOLD FILENAME 'C:\ibi\ACSGROUP' FORMAT ALPHA
-*ON TABLE SAVE AS 'C:\ibi\ACSGROUP' FORMAT ALPHA
ON TABLE PCHOLD FORMAT WP
END
-RUN
-EXIT




WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 04, 2019, 01:04 PM
FP Mod Chuck
I was looking to see if you had a style sheet that might have some wrapping syntax but you don't even reference one so I really don't know why the data is wrapping.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
October 04, 2019, 04:43 PM
AMC2
My sentiments also.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 06, 2019, 02:41 PM
Doug
Have you considered 'APP HOLDMETA' and 'APP HOLDDATA' before your TABLE FILE request. I use them for, what I consider, the easiest way to accomplish this result. WARNING: Be careful not to overwrite some file that should not be overwritten.
October 07, 2019, 08:50 AM
jgelona
Any chance your data has embedded Line Feed characters? That will cause you data to mysteriously wrap. I used this to dump a file with a 4000 character text field. I got no wrapping except when there were embedded line feed character in the field.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
October 07, 2019, 01:07 PM
AMC2
I did try APP HOLDMETA and APP HOLDDATA and did not have success.

Yes, I think the data may contain some embedded line feed characters or something.

I think generating it directly into an Excel file will serve the purpose though.

Thanks for your help.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc
October 07, 2019, 09:05 PM
StuBouyer
When you FILEDEF to C: (or other) drive it relative to the Reporting server, not to the machine you are connecting from.

If PCHOLD is causing issues for you you can try the following:

APP MAP FILEDROP \\your_machine_name\share
APP PREPENDPATH FILEDROP
FILEDEF ACSGROUP DISK FILEDROP/ACSGROUP.ALPHA


Then
ON TABLE SAVE AS ACSGROUP FORMAT ALPHA

or
ON TABLE HOLD AS ACSGROUP FORMAT ALPHA

Note: for WebFOCUS to be able to write to the share it will probably need to be running as an AD user and the LOCAL_SYSTEM user is not able to see shares by default.

A quicker and far simpler option may be to have your admins create a share to the APP folder you are going to drop the file into and give you read/write access to that share

Cheers

Stu

Edit to update signature


WebFOCUS 8.2.03 (8.2.06 in testing)
October 08, 2019, 04:45 PM
AMC2
Ok thanks. It is running as an AD user. Thanks for your post.


WebFOCUS 8.2.06
SQL Server
HTML, PDF, Excel, etc