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.
I am in need to convert the order numbers (from 00001 to 99999) present in numeric format to alphanumeric format starting from (A001...A009...A00A...A00Z...A010...A019...A01A...A01Z...A020 and so on).
Is there a in-built function in Focus to provide similar results.
Thanks, ShrikantThis message has been edited. Last edited by: Shrikant,
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
Here's JG's approach, coded in Define for the problem at hand.
DEFINE FILE yourfile
BASE/I2=36;
CHARS/A36='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
I/I10=NUMBER;
Z/I2 = IMOD(I,BASE,'I2');
I=INT(I/BASE);
Y/I2 = IMOD(I,BASE,'I2');
I=INT(I/BASE);
X/I2 = IMOD(I,BASE,'I2');
XX/A1=SUBSTR(36,CHARS,X+1,X+1,1,'A1');
YY/A1=SUBSTR(36,CHARS,Y+1,Y+1,1,'A1');
ZZ/A1=SUBSTR(36,CHARS,Z+1,Z+1,1,'A1');
CODE/A4='A' | XX | YY |ZZ;
CHECK/I10 = X*BASE*BASE + Y*BASE + Z;
END
TABLE FILE yourfile
LIST NUMBER X Y Z CODE CHECK
END
NUMBER is the incoming value (integer); CODE is the resulting Axxx value. For a code scheme with three base-36 digits, the maximum encodable Number is 46655.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I have implemented JG's and Jack's code successfully. I have done a slight modification to Jack's code as mentioned below to meet the actual requirement.
DEFINE FILE file
BASE/I2=36;
CHARS/A36='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
I/I10=NUMBER;
Z/I2 = IMOD(I,BASE,'I2');
I=INT(I/BASE);
Y/I2 = IMOD(I,BASE,'I2');
I=INT(I/BASE);
X/I2 = IMOD(I,BASE,'I2');
I=INT(I/BASE);
W/I2 = IMOD(I,BASE,'I2');
WW/A1=SUBSTR(36,CHARS,W+11,W+11,1,'A1');
XX/A1=SUBSTR(36,CHARS,X+1,X+1,1,'A1');
YY/A1=SUBSTR(36,CHARS,Y+1,Y+1,1,'A1');
ZZ/A1=SUBSTR(36,CHARS,Z+1,Z+1,1,'A1');
CODE/A4= WW | XX | YY |ZZ;
END
TABLE FILE file
PRINT CODE
BY NUMBER
END
Thanks again for all your help!!
-Shrikant
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007
I would also like to hear from you guys if this can be met without a input file, meaning FOCUS actually generating the similar alphanumeric values to a certain defined limit instead of converting the numbers stored in a data file.
FOCUS 7.2.3 Platform: IBM system Z9 Business class O/P formats: Flat files, excel and CSV files
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007