-
-
Save NielsLiisberg/9ca47191bae9f301c0f00310201aaab6 to your computer and use it in GitHub Desktop.
delete from qtemp.c; | |
insert into qtemp.c (srcdta) values | |
('{'), | |
('int m,f,l;'), | |
('m = 00002 + 00010 + 00400 ;'), | |
('IFS_APPEND.NAME.DAT[IFS_APPEND.NAME.LEN] =0;'), | |
('f = open(IFS_APPEND.NAME.DAT, m);'), | |
('l = write(f, IFS_APPEND.BUF.DAT,IFS_APPEND.BUF.LEN);'), | |
('close (f);'), | |
('}') | |
; | |
create or replace procedure qusrsys.ifs_append(name varchar(256), buf varchar(32700)) | |
set option output=*print | |
begin | |
if buf is not null then | |
include qtemp/c(c); | |
end if; | |
end; | |
-- Test it like this | |
call qusrsys.ifs_append('/tmp/test.txt' , 'Hello'); | |
Sorry! My fault- you need QSYSINC library installed ... I can make a version without this requirement..
The early version did not have that dependency - so please use this if you don't have QSYSINC installed:
Seems like the ifs_append procedure has been overwritten by the corresponding ifs_write procedure!
Any chance to get the correct version of ifs_append back?
It's back - sorry !!
Thanks! :-)
Hi,
create procedure error:
ID MES SEV RECORD TESTO
SQL0007 20 95 Posizione 1 Carattere '{' (HEX X'44') non valido
nell'istruzione SQL.
SQL0007 20 98 Posizione 20 Carattere '[' (HEX X'90') non valido
nell'istruzione SQL.
SQL0007 20 98 Posizione 40 Carattere ']' (HEX X'51') non valido
nell'istruzione SQL.
SQL0007 20 102 Posizione 1 Carattere '}' (HEX X'54') non valido
nell'istruzione SQL.
Hello @emidioporziella, I think you need to press the "raw" button in the gist before you copy the source into your ACS. If not maybe you have to set the ccsid on the source file in line 2. So try this updated version.
Hi Niels,
I've solved using ACS.
Thank's a lot.
Great !! My pleasure :)
Same here.. :)
Line #10