Midrange News for the IBM i Community


Posted by: WestCoastGuy
Updating a source text (TXT) file
has no ratings.
Published: 27 Feb 2012
Revised: 23 Jan 2013 - 2187 days ago
Last viewed on: 17 Jan 2019 (4232 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Updating a source text (TXT) file Published by: WestCoastGuy on 27 Feb 2012 view comments(8)

I have a need to change the name of the file being FTP'ed to a network folder. My idea is to read the source text member with a RCVF command and update the line in the source file if a condition is met. The code that I have so far changes the data read from the file, but I need that source line to be updated back to the text file. What do I do to make that happen?

 

Here is the code -

RTVJOBA DATE(&DATE)                             
                                                
OVRDBF FILE(QCLSRC) MBR(FTPAUDJRNL)             
                                                
TAG1: RCVF                                      
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM1))
CHGVAR &CMD VALUE(%SST(&SRCDTA 1 3))    

        
IF COND(&CMD *EQ 'put') THEN(DO)                
  CHGVAR (%SST(&SRCDTA 29 6)) VALUE(&DATE)      
ENDDO        

                                   
DMPCLPGM                                        
GOTO TAG1                                       

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS