Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FTP an APPENDed file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] FTP an APPENDed file
 Login/Join
 
Member
posted
I'm looking for a way to FTP a file out to a web server on a scheduled basis, Caster right?

Here's the issue, the file is a concatenation of two different record formats. (email address book)

The first record is static string and used as a header row for the output, the detail records are dynamic and need to be in a CSV format.

I'm having trouble building the file so the output is in the right format and still get Caster to distribute it.

So far what I've done is create a flat file with the first record then appended the details onto it.

It creates the output correctly if I use HOLD but Caster won't distribute it. If I use PCHOLD the APPEND is ignored so there's no header row on the output.

I'm open to any suggestions on how to get to the desired result but here's what I have at this point:

******** Flat File named CARTEST.TXT

:::TAGMAP:::0FFE0003:CAR,3001001E:MODEL,3A08001E:SEATS

******** FEX to APPEND detail rows

FILEDEF CARTEST DISK D:\ibi\apps\weitznetdirectory\CARTEST.TXT (APPEND

TABLE FILE CAR
PRINT CAR MODEL SEATS
BY COUNTRY NOPRINT
ON TABLE HOLD AS CARTEST FORMAT COM
END

*********** Desired OUTPUT format, note there are no quotes around the data in the first row

:::TAGMAP:::0FFE0003:CAR,3001001E:MODEL,3A08001E:SEATS
"JAGUAR","V12XKE AUTO",2
"JAGUAR","XJ12L AUTO",5
"JENSEN","INTERCEPTOR III",4
"TRIUMPH","TR7",2
"PEUGEOT","504 4 DOOR",5
"ALFA ROMEO","2000 4 DOOR BERLINA",4
"ALFA ROMEO","2000 GT VELOCE",2
"ALFA ROMEO","2000 SPIDER VELOCE",2
"MASERATI","DORA 2 DOOR",2
"DATSUN","B210 2 DOOR AUTO",4
"TOYOTA","COROLLA 4 DOOR DIX AUTO",4
"AUDI","100 LS 2 DOOR AUTO",5
"BMW","2002 2 DOOR",5
"BMW","2002 2 DOOR AUTO",4
"BMW","3.0 SI 4 DOOR",5
"BMW","3.0 SI 4 DOOR AUTO",5
"BMW","530I 4 DOOR",5
"BMW","530I 4 DOOR AUTO",5

*******

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


WF 7.6.12 Reporting, 7.6.11 Client, MS Windows 2003 64, HTML/PDF/EXL2K/AHTML
 
Posts: 3 | Registered: September 29, 2006Report This Post
Virtuoso
posted Hide Post
Here's one possibility - after you've created both pieces of the file, do an ON TABLE HOLD. Then FILEDEF and read that file as a fixed format with an alternate MFD that is basically
FILENAME=FIXFILE, SUFFIX=FIX , $
SEGMENT=FIXFILE, SEGTYPE=S0, $
FIELDNAME=FIELD1, ALIAS=FIELD1,USAGE=A200,ACTUAL=A200,$

with format for however long the longest line might be. You should be able to output in whatever text or fixed format you need from there and FTP it as needed.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
Thanks for your time Darin, hadn't thought of that but it seems perfectly reasonable.

After posting I tried using an OS script to move the file after the fact. So now I'm digging around to see if Windows DOS commands can be inbedded in the FEX, guessing the answer is yes I've just never done it...

I'll give both a go and post back on the results.

Thanks again Darin!
 
Posts: 3 | Registered: September 29, 2006Report This Post
Guru
posted Hide Post
DOS commands can be embedded into a fex.

Happy New Year!



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
Absolutely. You can use dos commands on the Windows platform to accomplish a lot of these things including a "manual" automated FTP script. I was assuming that you were wanting to stick with RC as the vehicle, but that doesn't have to be the case.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
Two answers so far thanks to the help given here.

1) Darin's first suggestion, using a second MFD:

***** FIXFILE.MAS

FILENAME=CARTEST , SUFFIX=FIX , $
SEGMENT=SEG01, SEGTYPE=S0, $ FIELDNAME=CAR,CARS,A100,$ FIELDNAME=MODEL,MODEL,A24,$
FIELDNAME=SEATS,SEAT,I3,$

****** FEX to APPEND detail rows

FILEDEF CARTEST DISK D:\ibi\apps\weitznetdirectory\CARTEST.TXT (APPEND
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY COUNTRY NOPRINT
ON TABLE HOLD AS CARTEST FORMAT COM
END

FILEDEF FIXFILE DISK D:\ibi\apps\weitznetdirectory\CARTEST.TXT
-RUN

TABLE FILE FIXFILE
PRINT *
END

***** Make sure to check the RC output format used with this or the quotes may get added back to the first row

2) Use DOS - Ah-Ha for the day!

****** FEX to APPEND detail rows

FILEDEF CARTEST DISK D:\ibi\apps\weitznetdirectory\CARTEST.TXT (APPEND
TABLE FILE CAR
PRINT CAR MODEL SEATS
BY COUNTRY NOPRINT
ON TABLE HOLD AS CARTEST FORMAT COM
END

DOS ftp -sBig Grin:\ibi\apps\weitznetdirectory\car.bat
-RUN

****** car.bat

open 123.12.12.123
username
password
cd /directory/directory
put D:\ibi\apps\weitznetdirectory\CAR.NAB
quit

******

Top of mind thought is solution 1 will work well for formats allowed for in RC and keeps everything in one place so you don't have to remember while solution 2 will handle things RC doesn't, like an address book import file.

Thanks again Darin & Carol, your help was much appreciated!

Steve


WF 7.6.12 Reporting, 7.6.11 Client, MS Windows 2003 64, HTML/PDF/EXL2K/AHTML
 
Posts: 3 | Registered: September 29, 2006Report This Post
Expert
posted Hide Post
i would have taken the truly lazy way out...
and the 2nd file
DEFINE FILE CAR
COMMA/A1=',';
CAR2/Ann='"' | CAR | '"';
..etc
END
TABLE FILE CAR
PRINT CAR2 COMMA MODEL2 COMMA SEATS
BY COUNTRY NOPRINT
ON TABLE HOLD AS CARTEST FORMAT ALPHA
END

might have slapped an LRECL 80 or somesuch on my first filedef.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FTP an APPENDed file

Copyright © 1996-2020 Information Builders