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.
What kind of table is it? Fixed, relational,? For fixed format, you could define the master with an OCCURS.
For other file types, you can TABLE the data as such:
DEFINE FILE FILE1 ONE/I1=1; TWO/I1=2; THREE/I1=3; END TABLE FILE FILE1 PRINT ONE COL1NO TWO COL2NO THREE COL3NO BY WHATEVER ON TABLE HOLD FORMAT ALPHA END
Then create another master using OCCURS, filedef the hold file to it. Then you can table it vertically.
Also look up the MacGyver technique which might be useful here.
Also, please update your profile signature with your product suite, releases and platform as Glenda and I have done. That makes it easier for us to help you.
I think you can only do this using multiple passes, though someone cleverer may have a better idea:
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
FILEDEF DATAMAST DISK NUMBER.MAS
-RUN
-WRITE DATAMAST
-WRITE DATAMAST FILE=NUMBER, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S0, $
-WRITE DATAMAST FIELD=ACCOUNT, ALIAS=E01, USAGE=A50, ACTUAL=A50, $
FILEDEF NUMBER DISK NUMBER.FTM
-RUN
-WRITE NUMBER {number:12345}
-WRITE NUMBER {number:23456}
-WRITE NUMBER {number:34567} {number:45678}
-WRITE NUMBER {number:56789} {number:01234} {number:11234}
-WRITE NUMBER {number:11345}
-WRITE NUMBER {number:11456}
-RUN
DEFINE FILE NUMBER
ACCOUNT1/A5 WITH ACCOUNT = SUBSTR(60, ACCOUNT, 9, 13, 5, 'A5');
ACCOUNT2/A5 WITH ACCOUNT = SUBSTR(60, ACCOUNT, 24, 28, 5, 'A5');
ACCOUNT3/A5 WITH ACCOUNT = SUBSTR(60, ACCOUNT, 39, 43, 5, 'A5');
END
-RUN
TABLE FILE NUMBER
PRINT
ACCOUNT1 AS ACCOUNT
ON TABLE HOLD AS HACCOUNT1
END
-RUN
TABLE FILE NUMBER
PRINT
ACCOUNT2 AS ACCOUNT
ON TABLE HOLD AS HACCOUNT2
WHERE ACCOUNT2 NE ''
END
-RUN
TABLE FILE NUMBER
PRINT
ACCOUNT3 AS ACCOUNT
ON TABLE HOLD AS HACCOUNT3
WHERE ACCOUNT3 NE ''
END
-RUN
TABLE FILE HACCOUNT1
PRINT ACCOUNT
BY ACCOUNT NOPRINT
ON TABLE HOLD AS HACCOUNT
MORE
FILE HACCOUNT2
MORE
FILE HACCOUNT3
END
-RUN
TABLE FILE HACCOUNT
PRINT *
END
-RUN
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
The code Frances sent will also work if the data is already in separate fields as long as the fields are formatted the same. If not, then you use a defined field to make them the same.
Francis,
You are supposed to be relaxing and having fun this week. But it's always nice to hear from you.
if its the same field im sure there is a fucntion that allows you to take out parts of a field based on a delimiter, i used to have to do this with access vb so will have to look into the WF solution... although provided the numbers are always entered in the field the same way Francis' code should always work.
Developer Studio 7.64 Win XP Output: mostly HTML, also Excel and PDF
"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
Posts: 285 | Location: UK | Registered: October 26, 2007
Yes it's great here, I found some time to relax by posting on focalpoint.....
One of the best things here is shaking hand with all the focalpoint users you never see. Discovering that the man behind the nickname is a woman and the other way around....
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Even if the data is in a single field, you could put it in a hold file and do an alternate master with an occurs in it. Once the data is in the hold file, it is just a giant string that you can parse anyway you like.
I am glad I ran into this thread. I am looking for a solution for a similar problem.
I am using DataMigrator 764 and have a data flow which moves data from a source table (MSSQL) to a target table (MSSQL).
Both Source and target tables have two columns - Dept_ID and City.
Source table values are -
Dept_ID City 001 Chicago, Lisle, Naperville 002 Detroit, Southfield, Kalamazoo
I would like to load this data into my target table as
Dept_ID City 001 Chicago 001 Lisle 001 Naperville 002 Detroit 002 Southfield 002 Kalamazoo
How do I explode each single row in source into multiple rows in target? What function can I use to parse the field value if the delimiter is a carriage return instead of a comma?
Thanks.
iSM 616 iDM 7705 iDQC 802 WF 77 Windows 2008 Server
I've not tried this but look this up in Advanced Search using DFIX as the keyword:
quote:
Syntax: How to Define a File With Delimiters Delimiters must be defined in the Master File. The FILE declaration must include the following attribute:
SUFFIX=DFIXDescribe the delimiter characters in a special field or group named DELIMITER. The delimiter characters are specified in the ALIAS attribute of this special field or group.
To use a delimiter that consists of a single non-printable character or of one or more printable characters, the delimiter is defined as a field with the following attributes:
FIELDNAME=DELIMITER, ALIAS=delimiter, USAGE=ufmt, ACTUAL=afmt ,$To use a delimiter that consists of multiple non-printable characters or a combination of printable and non-printable characters, the delimiter is defined as a group:
Indicates that the field or group is used as the delimiter in the data source.
delimiter
Identifies a delimiter. For one or more printable characters, the value consists of the actual characters. The delimiter must be enclosed in single quotation marks if it includes characters used as delimiters in Master File syntax. For a non-printable character, the value is the decimal equivalent of the EBCDIC or ASCII representation of the character, depending on your operating environment.
ufmt, afmt
Are the USAGE and ACTUAL formats for the delimiter. Possible values are:
Thank you very much for your time and suggestions. In working with the owner of the mySQL DB it is clear the data needs to be cleaned. Once that is done I am sure the suggestions will work. Until then the data is such a mess I can't even test it.
Zippo
Posts: 12 | Location: New Yawk | Registered: February 16, 2006
I suggest you start another thread with your problem. Also, it would be helpful is you could indicate the format of the City field and the max number of cities per Dept.
See the new topic I started.This message has been edited. Last edited by: Danny-SRL,
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006