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] Convertirn to Packet trough Modify

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convertirn to Packet trough Modify
 Login/Join
 
Gold member
posted
Hi all,

We have a file that is all in alphanumeric format, including imports. Example are like:

270.00- (16 positions)

We need to load a focus file, wich in the master, those imports are like P16.2. Note the sign is on the right.

So, in the modify I have a COMPUTE like:

QTY_AMNOAC/P17.2 = IF S2 EQ '-' THEN (-1)*EDIT(TC2) ELSE EDIT(TC2);

Where QTY_AMNOAC is the fieldname in the master. S2 and TC2 are temporary fields created in the MODIFY to read the values in the file, like this:

FIXFORM TC2/15 S2/1

Something must be wrong, because is always returning bad values, example:

10000.00 + is returning ,00.
99999999999.99 + is also returning ,00.

Any thoughts about it?

Thanks in advance.

Regards.

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



____________________________________________
Ruben Rueda
Consultant
Information Builders Iberica

Web: http://www.eruben.biz

Prod: WF 5.3.4 @ Red Hat Enterprise Linux ES 3 (Taroon Update 6) w/Oracle 9i
Test: WF 5.3.3 @ SUN Solaris 7 w/Oracle 8i
 
Posts: 52 | Location: Madrid | Registered: July 18, 2005Report This Post
Platinum Member
posted Hide Post
Hi Ruben:

This code works for me:

MODIFY FILE CAR
COMPUTE TC2/A15 = ;
COMPUTE S2/A1   = ;
FIXFORM TC2/15 S2/1

-* EDIT
COMPUTE QTY_AMNOAC1/P17.2 = IF S2 EQ '-' THEN (-1)*EDIT(TC2) ELSE EDIT(TC2);

-* ATODBL.
COMPUTE SIGN/P2 = IF S2 EQ '-' THEN -1 ELSE 1 ;
COMPUTE QTY_AMNOAC2/P17.2 = ATODBL(TC2, '15', 'D15.2') * SIGN ;

-* Output display.
TYPE "------------------------------"
TYPE "TC2........: <TC2 "
TYPE "S2.........: <S2 "
TYPE "QTY_AMNOAC1: <QTY_AMNOAC1 "
TYPE "QTY_AMNOAC2: <QTY_AMNOAC2 "
GOTO TOP
DATA
         270.00-
       10000.00+
123456789012.34-
END
-RUN



The output is:

------------------------------
TC2........:          270.00 
S2.........: - 
QTY_AMNOAC1:           -270.00 
QTY_AMNOAC2:           -270.00 
------------------------------
TC2........:        10000.00 
S2.........: + 
QTY_AMNOAC1:          10000.00 
QTY_AMNOAC2:          10000.00 
------------------------------
TC2........: 123456789012.34 
S2.........: - 
QTY_AMNOAC1:  -123456789012.34 
QTY_AMNOAC2:  -123456789012.34 


Regards
Mikel
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Gold member
posted Hide Post
EDIT still seems not to work, but ATODBL did the trick, and its converting all the fields correctly.

Thank you Mikel!



____________________________________________
Ruben Rueda
Consultant
Information Builders Iberica

Web: http://www.eruben.biz

Prod: WF 5.3.4 @ Red Hat Enterprise Linux ES 3 (Taroon Update 6) w/Oracle 9i
Test: WF 5.3.3 @ SUN Solaris 7 w/Oracle 8i
 
Posts: 52 | Location: Madrid | Registered: July 18, 2005Report This Post
Expert
posted Hide Post
May I ask why you do not convert the text to a packed number with the master file, then the EDIT is not needed.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 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] Convertirn to Packet trough Modify

Copyright © 1996-2020 Information Builders