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)Changing Field Format - What am I missing?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
(SOLVED)Changing Field Format - What am I missing?
 Login/Join
 
Master
posted
I'm trying to create a text file without trailing blanks and I want to dynamically change the format as describe in the following:

Changing Field Format

Here's my code:
DEFINE FILE XXXX
   PLINE/A100=PLNM || (',' | PFNM) || (',C/' | ACLID);
   PLEN/I3=ARGLEN(100,PLINE,'I3');
   FMT/A4='A' | EDIT(PLEN);
END
TABLEF FILE XXXX
PRINT PLINE/FMT
ON TABLE SAVE
END


I have confirmed that FMT contains values like A033, A040, etc. Is there some SET command needed for this? I've tried using TABLE as well and get the same error.
I'm getting the following error:
(FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE: FMT
(FOC009) INCOMPLETE REQUEST STATEMENT

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Platinum Member
posted Hide Post
see if this helps.

FILEDEF CARSAVE DISK C:\IBI\APPS\BASEAPP\carsave.ftm
DEFINE FILE CAR
PLINE/A100=COUNTRY || (',' | CAR) || (',C/' | MODEL);
PLEN/I3=ARGLEN(100,PLINE,'I3');
FMT/A4='A' | EDIT(PLEN,'999');
SLASH/A1 = '/';
NEW_FIELD/A110 = PLINE || SLASH || FMT;
END
TABLEF FILE CAR
PRINT NEW_FIELD
ON TABLE SAVE AS CARSAVE
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Master
posted Hide Post
Spence, thanks for the suggestion, but that won't do anything other than print PLINE with '/Axxx' on the end of the line. What I'm wanting to do is to print only the 1st 20 characters of PLINE if the last 80 are blank. For example, look at the following rows:
AAB,JESSIE,C/4151738
AAB,KAREN,C/2837056
AAB,MEAGAN,C/4151739
AAB,MIKE,C/2837057
AADAHL,ARVID L,C/545469
AADAHL,JANA L,C/545467
AADAHL,LAURA C,C/545468
AADAHL,ROGER N,C/545465
AAGESEN,DANNY,C/3762118
AAHPFOHMYYOH,MR AAHPFOHMYYOH,C/1623274

each of these lines are 100 characters in length. So on the 1st row, I want write out PLINE with a format of A20, the second line with A19, the third line with A20 and so on. According to the example in the article what I did should work unless I am missing something.

I could use the Linux sed command to truncate the line, but this file will have over 18 million rows and that still takes a while. I thought I could save some processing and I/O by having WF only write the significant characters of each row.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
FMT/A8='A' | EDIT(PLEN);

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
I knew it was something easy that I missed. So it has to be an A8 field. Now the problem is that it still writes the full 100 characters to the file. I guess I'll open a problem report.
Thanks.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
And why exactly is that a problem? You can use the dynamic format for displaying information in a different format in your report. This can be teh Axx format or the Dxx or the Ixx format, used for the same column but in different situations. When you display this that's ok, but if you wish to hold this then what format should be recorded in the master file?
So, if you use dynamic formatting, this wil (can) not be held in an intermediate file.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Master
posted Hide Post
I guess I was making this too hard. Using:

ON TABLE SAVE AS xxxx FORMAT TABT


does what I need.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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)Changing Field Format - What am I missing?

Copyright © 1996-2020 Information Builders