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     How do I get this format in my extract file?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How do I get this format in my extract file?
 Login/Join
 
Platinum Member
posted
Hi All,

I'm creating an extract file which includes a numeric field with 2 decimal places(D12.2) and I want the format to be as follows:

8281.11 should look like this --> 00082811A
2789.22 should look like this --> 00027892B
2753.06 should look like this --> 00027530F

Is there a format option or a function that will create this format?

I usually use ON TABLE HOLD AS myfile FORMAT ALPHA to create my extract files.

Thanks
Jim


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
 
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005Report This Post
Master
posted Hide Post
THE first step would be to create a new field format A12 and perform an edit of the real field like this
NEWFLD/A12 = EDIT(REALFIELD);

Then get the last char and then decode it to what you want.
LSTCHAR/A1 = EDIT(NEWFLD, '$$$$$$$$$$$9');
NEWCHAR/A1 = DECODE LSTCHAR('1' 'A' '2' 'B' .....);

Then construct the new out field
OUTFLD/A12 = EDIT(NEWFLD, '99999999999$') | NEWCHAR;

I have not tested it but it should point you in the right direction

Hope this helps
I




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
Are you looking to handle negative values as well with your last digit? TexasStingray has nice solution, of course what will you do with the output. An IBM mainframe number translates to something else in the ascii world so you would have to allow for that as well.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
TexasStingray/Leah,

This is what I've done and it seems to be working.

-*
TMP_EXP/D9 = TOT_EXP * 100;
ALPHA_EXP/A9 = EDIT(TMP_EXP);
LST_CHAR/A1 = EDIT(ALPHA_EXP,'$$$$$$$$9');
NEW_CHAR/A1 = IF TOT_EXP LT 0
THEN DECODE LST_CHAR
('0' '}' '1' 'J' '2' 'K' '3' 'L' '4' 'M' '5' 'N' '6' 'O' '7' 'P' '8' 'Q' '9' 'R' ELSE '?')
ELSE DECODE LST_CHAR
('0' '{' '1' 'A' '2' 'B' '3' 'C' '4' 'D' '5' 'E' '6' 'F' '7' 'G' '8' 'H' '9' 'I' ELSE '?');
NEW_EXP/A9 = EDIT(ALPHA_EXP,'99999999$') | NEW_CHAR;
-*

Thanks for the help!!

Jim


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
 
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005Report 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     How do I get this format in my extract file?

Copyright © 1996-2020 Information Builders