Focal Point
[SOLVED] on data source

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/819101902

August 14, 2009, 08:32 AM
Vasantha kumar
[SOLVED] on data source
Hi all,

I have created a new master file. I want to add some data (.foc file) into it. Is power painter an only option?
If not then how do i do that? If someone explain with an example then it would be fine.

This message has been edited. Last edited by: Kerry,


Vasantha kumar
7.1.4/ Unix / OF:EXL2K
August 14, 2009, 08:37 AM
Danny-SRL
where does your data come from?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 14, 2009, 08:49 AM
Vasantha kumar
Hi danny,

It is just a dummy file with only one field like the one given in the post on McGyver's technique.

When i run the file it says No .Foc file found. so my question is, how do populate that file to make the procedure run?


Vasantha kumar
7.1.4/ Unix / OF:EXL2K
August 14, 2009, 10:03 AM
GinnyJakes
Look up the MODIFY command and use FIXFORM and the DATA statement to populate your file.

However, if you are using McGyver, you can also use a flat file.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
August 14, 2009, 11:16 AM
Danny-SRL
Vasantha

As Ginny says: read up on the MODIFY command.

You say that your focus file has one field. Something like this:
  
FILENAME=NUM,SUFFIX=FOC
 DATASET='C:\ibi\apps\baseapp\NUM.FOC'
SEGNAME=ORIGIN,SEGTYPE=S1
 FIELDNAME=NUM,NUM,I3,$

Suppose you want to load numbers from 1 to 100. You use the MODIFY command:
  
MODIFY FILE NUM
FREEFORM NUM
MATCH NUM
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA
-REPEAT #VASA FOR &I FROM 1 TO 100;
NUM=&I ,$
-#VASA
END

This should do the trick.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 17, 2009, 05:31 AM
Vasantha kumar
Hi danny,

Thanks!

When i use the same code with my values in it, it says "(FOC198) FATAL ERROR IN DATABASE I/O" - error. I have given a correct location for the .FOC file.

But code works fine without the DATASET command.
Even I am able to see the output when i use the TABLE FILE inside the same proc.

But why am i not able to see the output when i use the file in another proc? I want to physically store that data file in UNIX. How could i achieve this?


Vasantha kumar
7.1.4/ Unix / OF:EXL2K
August 17, 2009, 09:16 AM
GinnyJakes
Try doing a CREATE FILE filename before the MODIFY.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
August 17, 2009, 10:24 AM
GamP
But beware: when you do a CREATE file, the file will be written in the temporary directory. If you want it to be stored somewhere else, issue a APP HOLD before doing the create, in your case a APP HOLD BASEAPP.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 17, 2009, 11:03 AM
GinnyJakes
While what GamP says is generally true, but because he has a DATASET parameter in his master, the file will go there.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
August 20, 2009, 07:33 AM
Danny-SRL
Vasantha,

So you discarded the DATASET attribute. That's OK. Now you have to tell WF where to put the database. For that 2 things:
1. You use the USE command
2. You must have write permission to the directory where you want to write the focus database.

USE 
[pathname]/NUM.FOC NEW
END
CREATE FILE NUM
MODIFY FILE NUM
FREEFORM NUM
MATCH NUM
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA
-REPEAT #VASA FOR &I FROM 1 TO 100;
NUM=&I ,$
-#VASA
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

August 21, 2009, 06:27 AM
Vasantha kumar
Thanks danny!

It works.. Smiler


Vasantha kumar
7.1.4/ Unix / OF:EXL2K
August 21, 2009, 06:31 AM
Vasantha kumar
[SOLVED]Originally posted by Vasantha kumar:
Thanks danny!

It works.. Smiler[/QUOTE]


Vasantha kumar
7.1.4/ Unix / OF:EXL2K