• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Trying to append blank spaces on certain lines for ACH File

irfan.refai

Member
Hi guys!

I made a copy of the R04572T1 Create A/P Bank Tape - PPD Format since the bank we use has certain requirements for their ACH file format. The trouble I'm having is that on certain records, namely the File Header record (Record Type 1) and the File Control record (Record Type 9) they require 8 spaces at the end of the Type 1 record for a total of 94 characters and 39 spaces at the end of the Type 9 record also for a total of 94 characters. When the file gets created these lines have a carriage return/line feed immediately after the last character and just ignores the spaces. I've tried different approaches from concatenating spaces to the string (which is a global RV with 240 characters) to using the rpad function with the string. I've also used the Add a Carriage Return to String (B9861B) in combination with the previous approaches. I still get the same result. Here's a snippet of the code for the Type 1 record to append 8 spaces using 3 approaches:

APPROACH 1

RV BuildString = concat([RV BuildString]," ") <--- at this point RV BuildString has 86 char in the string so we're just concatenating 8 spaces
RV Tape record - Global = substr([RV BuildString],0,94) <--- the substr is to insure that it has only 94 characters since the global RV is 240 characters in length

APPROACH 2

RV BuildString = rpad([RV BuildString],' ',94) <--- at this point RV BuildString has 86 char in the string so the rpad should add 8 spaces
Add a Carrige Return to String
RV Tape record - Global = substr([RV BuildString],0,94) <--- the substr is to insure that it has only 94 characters since the global RV is 240 characters in length

APPROACH 3


RV Tape record - Global = rpad(substr([RV BuildString],0,94),' ',94) <--- just a combination of the rpad and substr functions, again the RV BuildString has 86 char before it goes to this line.

Any ideas why the spaces get truncated and doesn't go to 94 characters?

Thanks in advance!!
 
Top