July 12, 2008, 10:21 AM
Cati - FranceAS400 HELP WANTED
HI all,
I have a problem to write a text file in the AS400 IFS (format ALPHA). It works only if I use FORMAT DB2 but it's not what I want.
Here is the fex and the error returned by webfocus.
SET TEMPERASE = ON
*===============================================
-SET &TMP_APP = &IBIC_user;
-TYPE &TMP_APP
-*=======================
APP DELETE &TMP_APP
-*=======================
CMD pwd > verif.txt
-RUN
FILEDEF VERIF DISK verif.txt
-RUN
-READ VERIF &TMP_APP.A43.
-TYPE &TMP_APP
SET TEMPERASE=OFF
APP MAP TMP_APP DISK &TMP_APP
APP MAP TMP_APP DISK &TMP_APP
APP PREPENDPATH TMP_APP
APP SHOWPATH
APP HOLD TMP_APP
-*===============================================
-
EB
APP FI DESC DISK &TMP_APP/lstan.mas
-RUN
-WRITE DESC FILENAME=lstan, SUFFIX=FIX ,DATASET=&TMP_APP.EVAL/LSTAN.FTM, $
-WRITE DESC SEGMENT=LSTAN, SEGTYPE=S1, $
-WRITE DESC FIELDNAME=ANNEE, ALIAS=E01, USAGE=A4, ACTUAL=A04, $
-RUN
-*================================================
-:ETAP_AN
-SET &YEARFIN = EDIT(&DATEDMYY,'$$$$$$9999');
-SET &YEARDEB = &YEARFIN - 10;
-SET &UTIL = GETUSER('A8');
-TYPE &YEARDEB
-TYPE &YEARFIN
-TYPE &UTIL
APP FI LSTAN DISK &TMP_APP/LSTAN.FTM
-RUN
-SET &CPT = 0;
-REPEAT :ECRIT 10 TIMES
-SET &CPT = &CPT+1;
-SET &YEAR = '&YEARDEB.EVAL' + &CPT;
-TYPE &YEAR
-WRITE LSTAN &YEAR
-:ECRIT
-*================================================
-:ETAP_AFF
TABLE FILE TABAFF
PRINT
AFF_LIB
COMPUTE CHOIXSSAFF/A1 = 'N';
BY AFF_CODE
WHERE AFF_CODE NE 'S';
ON TABLE HOLD AS AFF01 FORMAT ALPHA
END
-RUN
RESULT
/home/iadmin/ibi/srv76/wfs/edatemp/ts006995
tmp_app
clb
standard_v8
standard_v7
baseapp
ibisamp
exemples
help
baseapp
1998
2008
IADMIN
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
0(INF32080) NOMBRE D ENREGISTREMENTS DANS LA TABLE= 21 LIGNES= 21
0(INF32073) ERREUR A OU PRES DE LA LIGNE 67 DANS LA PROCEDURE w8st20s_launch
(FOC350) ERREUR D'ECRITURE DU FICHIER DE SORTIE: AFF01
If anybody knows what to do, I would appreciate to have the solution.
A poor french girl in troubles......
Thanks
July 13, 2008, 12:54 AM
Danny-SRLCati,
Apparently, WF is trying to write to a directory called "tmp_app" to which you do not have permission. This is due to
quote:
-READ VERIF &TMP_APP.A43.
-TYPE &TMP_APP
SET TEMPERASE=OFF
APP MAP TMP_APP DISK &TMP_APP
APP MAP TMP_APP DISK &TMP_APP
APP PREPENDPATH TMP_APP
APP SHOWPATH
APP HOLD TMP_APP
I suggest you look at that.
July 13, 2008, 03:15 AM
Cati - FranceHi Danny,
Thanks for the answer but the tmp_app is the directory created automatically by the TSCOM3 job running on the AS400.
I can create any object I want in this directory (master,..) except the file containing the data and I don't understand why.
I have all the permission needed to read, write, delete,....
It works if I do ON TABLE HOLD AS AFF01 FORMAT DB2 but in this case, the table is not created in the temp_app but in the default library of the user in the AS400. That's not what I want, I want the data to be in the temporary directory of the job.
I think this functioning is linked with the AS400 environment.
So, If anybody else has an idea.....
Thanks in advance.
Catherine
July 14, 2008, 09:08 AM
PBrightwellMaybe I am missing it, but I don't see a FILEDEF for AFFO1. Other than that, you might try changing your ON TABLE HOLD AS AFF01 FORMAT ALPHA to ON TABLE SAVE AS AFF01. I don't know why, but on our system SAVE retains our files where HOLD does not.
July 14, 2008, 09:12 AM
GamPCatherine,
It just might be possible that the file AFF01 is already there ...
You specify TEMPERASE to be off, and so someone may already have placed a file with the same name in the temp directory.
To check this (and be certain that the directory is clean as can be), you could do a 'CMD ls' just before the TABLE command. This will list all files in the directory.
Hope this helps a bit...
July 14, 2008, 09:13 AM
j.grossIn FOCUS on VM (the birthplace), SAVE respects your FILEDEF -- but HOLD ignores it, in order to ensure that the FOCTEMP and MASTER files are co-located. I believe that carries forward to WebFocus, and to other platforms.