Focal Point
Extraction of FOCUS database
March 12, 2007, 05:27 PM
Rajesh ReddyExtraction of FOCUS database
Hi All,
While extracting the data fron the FOCUS database and put into the flat file, I want delimit each field with delimiter"~". Can any one help me, how to separate the data with delimiter in the O/P file. I am extracting the data with segment wise.
TABLE FILE EMPLOYEE
PRINT EMPNBR
SEG.EMPNBR
SEG.EMPNAME
SEG.EMPNAM1
SEG.EMPBRANCH
Thanks,
Rajesh
March 12, 2007, 05:31 PM
Darin LeeShould be pretty straightforward. Here's one solution:
DEFINE FILE EMPLOYEE
DELIM/A1='~';
END
TABLE FILE EMPLOYEE
PRINT
EMPNBR DELIM
EMPNAME DELIM
EMPNAM1 DELIM
.
.
ON TABLE HOLD FORMAT ALPHA
END
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 12, 2007, 06:36 PM
Rajesh ReddyIf I print Field by Field its creating some issue when the number of fields are more. Hence I wanted to print all the fields in the segment using seg.
. In this scenario is there any command to delimit the fields in the segment, even though I am printing the whole segment at once.
Thanks
Rajesh
March 12, 2007, 07:35 PM
Darin LeeI don't think so. The only way to get something in between fields in a flat file is to put it there yourself. If this is relating to your other post on getting data into SQL server, just try
TABLE FILE filename
PRINT *
ON TABLE HOLD FORMAT SQLMSS
END
without knowing limitations of your platforms or environments, of course.
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 13, 2007, 09:26 AM
jgelonaAnother way, is do a HOLDFORAT TAB or COM. Then have a .MAS that describes the data as one field. Use the CTRAN function to convert the tabs or commas to ~.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.