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] Create a single line variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Create a single line variable
 Login/Join
 
Member
posted
I have a variable that is being output on 2 lines and would like it to be on a single line since it's causing some issues.

Example Output:

TABLE FILE CAR
PRINT CAR
WHERE CAR EQ '&CAR'
END

Variable is being input below:

TABLE FILE CAR
PRINT CAR
WHERE CAR EQ '
TOYOTA'
END


I've tried as many functions as I can but it isn't work and is clearly causing issues.

Thanks.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 26 | Location: Atlanta, GA | Registered: July 13, 2012Report This Post
Virtuoso
posted Hide Post
Do you know why is it wrapping to a second line?

What exactly does your variable (represented by &CAR in your posted code) contain -- what is its length, are there embedded newline characters, is it a single right-justified value (as you illustrate), or something more interesting? And how did the value get into the variable in the first place?

If you can answer that, then perhaps we can offer advice -- or perhaps you'll not be needing it.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
From where does &CAR is populate or assigned ? This is where you have to look at.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
I am creating a hold file and then using -READ to assign each one to a new variable.

TABLE FILE CAR
PRINT
DST.CAR
ON TABLE HOLD AS CARS
END

-SET &I = 1;

-REPEAT CARLOOP &LINES TIMES
-READ CARS NOCLOSE &CAR.A16.
-SET &CAR.&I = &CAR;
-SET &I = &I + 1;
-CARLOOP

This is just an example of what I am doing.

This message has been edited. Last edited by: Jonathan K.,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 26 | Location: Atlanta, GA | Registered: July 13, 2012Report This Post
Virtuoso
posted Hide Post
Consider following instead:

TABLE FILE CAR
BY CAR
ON TABLE HOLD AS CARS
END
-RUN

-SET &I = 0;

-REPEAT CARLOOP &LINES TIMES
-SET &I = &I + 1;
-READ CARS &CAR.A16.
-SET &CAR.&I = &CAR;
-TYPE &CAR.&I
-CARLOOP


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
I was able to get it to work some other way.

On the hold file I used FORMAT ALPHA then during the loop I used the EDIT function to extract what I wanted.

Thanks.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 26 | Location: Atlanta, GA | Registered: July 13, 2012Report This Post
Virtuoso
posted Hide Post
Hi Jonathan,

Will be great if you can share detailed solution with us by including your code, it can help other.

Also, edit the first post and add [SOLVED] at the beginning of your subject.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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] Create a single line variable

Copyright © 1996-2020 Information Builders