Re: FTPAPI

Vern Hamberg via RPG400-L <[email protected]>
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
Hi again

You don't need to get the job info - JOBLOG_INFO can use * to mean the 
job you are in.

I think SQL this way might be over-complex - you said below that you can 
put FTPAPI log entries into the job log. In the program that is calling 
the procedures from FTPAPI, when done, use DSPJOBLOG JOB(*) 
OUTPUT(*OUTFILE). Then use the generate_spreadsheet SQL service - you 
give it a SELECT statement, and that statement could have a WHERE clause 
to get only the rows from FTPAPI - I will assume there is some 
identifying marker.

*Regards*

*Vern Hamberg*

IBM Champion 2025 <cid:[email protected]> CAAC 
(COMMON Americas Advisory Council) IBM Influencer 2023


On 12/16/2025 1:02 PM, Greg Wilburn wrote:
> OK... so I would need to get the job info (number etc.) from PSDS?
>
> -----Original Message-----
> From: RPG400-L<rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of Marco Facchinetti
> Sent: Tuesday, December 16, 2025 12:04 PM
> To: RPG programming on IBM i<[email protected]>
> Subject: Re: FTPAPI
>
> With Sql it's very easy:
>
> BEGIN
>      CALL QSYS2.IFS_WRITE(
>          PATH_NAME *=>* '/tmp/logsample',
>          LINE *=>* '',
>          FILE_CCSID *=>* *1200*,
>          OVERWRITE *=>* 'REPLACE',
>          END_OF_LINE *=>* 'NONE'
>      );
>      FOR SELECT (*CHAR*(MESSAGE_TIMESTAMP) || ' - ' || MESSAGE_TEXT) AS
>   LOGLINE
>          FROM TABLE (
>                  QSYS2.JOBLOG_INFO('216955/MYUSER/MYJOB')
>              )
>          DO
>              CALL QSYS2.IFS_WRITE(
>                  PATH_NAME *=>* '/tmp/logsample',
>                  FILE_CCSID *=>* *1200*,
>                  LINE *=>* LOGLINE,
>                  OVERWRITE *=>* 'APPEND',
>                  END_OF_LINE *=>* 'CRLF'
>              );
>      END FOR;
> END;
>
> HTH
> --
> Marco Facchinetti
>
> Mr S.r.l.
>
> Tel. 035 962885
> Cel. 393 9620498
>
> Skype: facchinettimarco
>
>
> Il giorno mar 16 dic 2025 alle ore 16:16 Greg Wilburn <
> gwilburn-kuYYJ3CQfvZxq3Q2jbZZw/[email protected]> ha scritto:
>
>> I use Scott's LIBFTP (FTPAPI) occasionally instead of an FTP Script when
>> exchanging data.
>>
>> I would like to have a simple "text" log on the IFS for each FTP session.
>> With a script, I override OUTPUT to a PF in QTEMP, then using CPYTOIMPF to
>> create the text file.
>> (As CYA, I typically have DIR or LS in the script before I get and remove
>> files)
>>
>> With FTPAPI, the logging can go to the joblog by enabling FTP Logging.
>>   So, I'm considering using CPYSPLF to send the entire joblog to the IFS.
>> Just wondering if anyone has done something similar?
>>
>> TIA,
>> Greg
>> [Logo]<https://protect.checkpoint.com/v2/r01/___https://www.totalbizfulfillment.com/___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OjFmMDQ6MzdjZWRjMjcxOTU1NmMyYWEyOTJhMjU0NTJlOTBiZTEyNjA1NGFiMTcyMGVlZDMzOWZjYjU2Y2UzZjY1YzVmYTpwOlQ6Rg>    Greg Wilburn
>> Director of IT
>> 301.895.3792 ext. 1231
>> 301.895.3895 direct
>> gwilburn-kuYYJ3CQfvZxq3Q2jbZZw/[email protected]<mailto:gwilburn-kuYYJ3CQfvZxq3Q2jbZZw/[email protected]>
>> 1 Corporate Dr
>> Grantsville, MD 21536
>> https://protect.checkpoint.com/v2/r01/___www.totalbizfulfillment.com___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OjE3MzA6Y2RjMjcwM2Q2NmRlYzFjZjE0MGY1NWQ1ZDM4NDZkZjM2NjVjM2NhN2M0MGI5MmQ2M2RlNTYwZjdiMDA3MWM2MDpwOlQ6Rg<https://protect.checkpoint.com/v2/r01/___http://www.totalbizfulfillment.com___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OmUxODY6NjgyMTU2Nzk0MTBiMzQ2ZDc1MWMwMGMzZGI3MjZiYzUzYWFkOWNlYTgwYzI3ZDQyMzRmMmZhYjE5NTk1YzA0YTpwOlQ6Rg>
>> --
>> This is the RPG programming on IBM i (RPG400-L) mailing list
>> To post a message email:[email protected]
>> To subscribe, unsubscribe, or change list options,
>> visit:https://protect.checkpoint.com/v2/r01/___https://lists.midrange.com/mailman/listinfo/rpg400-l___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OmY2YmU6NjdlMjI4ZDdkZjhiODI2YmZkYjIyYjkzOTc1Y2ZjMmM0NjUyMWFiOTMyNDU1NjJmMjRlODU1Y2I4MDk5MjE0OTpwOlQ6Rg
>> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
>> Before posting, please take a moment to review the archives
>> athttps://protect.checkpoint.com/v2/r01/___https://archive.midrangecom/rpg400-l___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OjFiN2I6MTZmNmM2YjUwMmI3NDFjMGIwMDYyZTJkNjJjY2ZhOTAwM2JmZGVjZTQwNTYzZTRiZjViZDU3MmEyYmU3YjJiMTpwOlQ6Rg.
>>
>> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related
>> questions.
>>
>>
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email:[email protected]
> To subscribe, unsubscribe, or change list options,
> visit:https://protect.checkpoint.com/v2/r01/___https://lists.midrange.com/mailman/listinfo/rpg400-l___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OmRiNmQ6MWY0OWUzZjRkNzVkMjQxNWNmNWExZGYzY2E5MjhiMjQxMTIzNjE3ZDIwNmIyMDA3OWRiY2VkYTVhMTgyMDM0ODpwOlQ6Rg
> or email:RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
> Before posting, please take a moment to review the archives
> athttps://protect.checkpoint.com/v2/r01/___https://archive.midrange.com/rpg400-l___.YzJ1OnRvdGFsYml6ZnVsZmlsbG1lbnQxOmM6bzplYTE0YmZlMWIxMjFhNTMzMDhkYTQ0Y2Y2OTAzYzY2Mjo3OmVjNzE6YTk4MWYzYTI1NTllNGVlYjhlODBlMzIxMzZiOWQ0M2Y2Y2Y1ODVmZTZlMDUxZDdkYmM4MDU4ZTBhYzNiNzFhMTpwOlQ6Rg.
>
> Please contactsupport-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
>
>
>
> Greg Wilburn
> Director of IT
> 301.895.3792 ext. 1231
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.