Trying to append blank spaces on certain lines for ACH File

irfan.refai

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!!
 
I believe this is property of RV variables. Try with an ER variable and write the same in the file.
Let me know.
 
Hi ,

I am also facing similar issue .I have tried with varaibles but it didnt worked.Can any one suggest what can i do to append the blank spaces to make the line to specific length.
 
Hello!
We are using BIPublisher to create the text files with the eText templates.
Fixed size, and the <PAD> is by Left for numerics + '0' or Right for strings + ' ' (spaces)
So the PAD function will fill in the numbers for zeros or spaces until the record is completed.
i.e.: (last line) will be 391031______________ (the code + 14 spaces)
<LEVEL>Header_File_S19
<POSITION><LENGTH><FORMAT><PAD><DATA><COMMENTS>
<NEW RECORD>Header_Arquivo_Rec
13AlphaL, ‘0’‘237’
44AlphaL, ‘0’‘0000’
81AlphaL, ‘0’‘0’
99AlphaR, ‘ ‘
181NumberL, ‘0’Person_Corporation_Code_Header_ID36
1914NumberL, ‘0’Tax_ID_Header_Arquivo_ID34
3320AlphaR, ‘ ‘‘391031’


Hope it helps. This way is a lot easier to manage, build, change and test. Even for the functional team and/or key users.


Regards,
Cristiano
 
Back
Top