Focal Point
-WRITE on AS400 WebFOCUS

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

April 20, 2009, 02:32 PM
PBrightwell
-WRITE on AS400 WebFOCUS
Has anybody used -WRITE to update (APPEND to an AS400 flat file? Is there something special I need to do?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 20, 2009, 03:05 PM
GinnyJakes
Did you put the (APPEND on the filedef?


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
April 20, 2009, 03:44 PM
PBrightwell
My code

 
FILEDEF FOCAUDIT DISK RS6000/FOCAUDIT ( APPEND
-RUN
-* -SET &ECHO=ALL;
-SET &AUDIT_TIME = EDIT('&TOD.EVAL','99$99$99');
-SET &AUDIT_DATE = '&YYMD.EVAL'|'&AUDIT_TIME.EVAL';
-DEFAULT &AUDIT_USER='ouruser';
-SET &AUDIT_USER = GETUSER('A8');
-* -SET &AUDIT_FEX  = '&FEX.EVAL';
-SET &AUDIT_SRVR='400SRV';
-RUN

-WRITE FOCAUDIT  &AUDIT_DATE  &AUDIT_FEX  &AUDIT_USER  &AUDIT_SRVR
-RUN

 

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 20, 2009, 04:03 PM
Tom Flynn
Hi Pat,

Ginny is not on, so, I hope she doesn't mind...

Your dataset name should have a suffix, and, you'll need write access on it:

FILEDEF FOCAUDIT DISK RS6000/FOCAUDIT.dat or .ftm or .txt (APPEND

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 20, 2009, 04:05 PM
Diptesh Patel
Not sure about the AS400. But on an AIX box, I've found that a -RUN closes and reopens the output file... thus overlaying what was previously there. Is that what you are experiencing?

-Diptesh Patel


Diptesh
WF 7.1.7 - AIX, MVS
April 20, 2009, 04:06 PM
Tom Flynn
This looks like MRE, so, you may need:

APP FI FOCAUDIT DISK RS6000/FOCAUDIT.dat or .ftm or .txt (APPEND


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 20, 2009, 04:57 PM
PBrightwell
Tom,

The file extention doesn't apply on AS400, that's a pc/unix thing- none of our AS400 files has an extention.

Diptesh,

This same fex works on the AIX (UNIX with the UNIX path of course). Without the -RUN after the FILEDEF I get a message saying it isn't filedef'd


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 21, 2009, 03:42 AM
GamP
Pat,
You do need to have a a value for &AUDIT_FEX, since you write it out. But you had it commented, which may lead to unwanted results. The -RUN after the filedef is needed, but the one after the -SET's is not. The code would look like:
APP FI FOCAUDIT DISK RS6000/FOCAUDIT (APPEND
-RUN
-* -SET &ECHO=ALL;
-SET &AUDIT_TIME = EDIT('&TOD.EVAL','99$99$99');
-SET &AUDIT_DATE = '&YYMD.EVAL'|'&AUDIT_TIME.EVAL';
-DEFAULT &AUDIT_USER='WFOCUS';
-SET &AUDIT_USER = GETUSER('A8');
-SET &AUDIT_FEX  = '&FEX.EVAL';
-SET &AUDIT_SRVR='400SRV';

-WRITE FOCAUDIT  &AUDIT_DATE  &AUDIT_FEX  &AUDIT_USER  &AUDIT_SRVR
-RUN

But, is there some error that you receive or any undesired reuslts?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 21, 2009, 09:13 AM
PBrightwell
This is an online server procedure executed from our intranet interface. The &AUDIT_FEX is set in the individual program and this is -INCLUDEd. I -TYPEd my variables to be sure all had values and they are:

20090421080617 amd018a WFOCUS 400SRV

I also tried the AP FI instead of the FILEDEF with the same results. The message I am getting is somewhat meaningless it is

(FOC325) ERROR WRITING FILE NAMED: FOCAUDIT 1


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes