• 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!

Create a file for transmission to a bank.

cworley

Member
Hi All,
I need to create a .DAT file to be transmitted. It is an 80 Char ASCII file with numbers needing to be zero filled. I need to format the data as YYYYMMDD. I have written a report to do this, but do not know how to zero fill a number and how to force the date into the needed format.
Also, whenever I choose the output to CSV file, JDE takes me to Excel which plays havoc with my data layout. (Since some of my numeric data is quite long, it throws it into scientific notation or something similar). At this point, I could save it to text, but I would have to reformat all my Excel columns to get my proper file layout back. Does anyone have a suggestion on an easier way to do this, or had a similar situation?
Thanks.
 

WhippingBoy

VIP Member
Try concatenating it all together in one long field instead.

We wrote ours in C and did fwrite to a txt file. To be honest, we try not to use the JDE tools for specialized processes like this. Everything just seems to operate much more smoothly.

Darren Ricciardi - OneWorld Whipping Boy

Looking for work in OR NEAR Amsterdam THE NETHERLANDS
 

Zoltan_Gyimesi

Legendary Poster
Hi Cworley,


First of all, You Are Welcome on the Forums/Lists!

In response to your issue:
We have done somthing similar like Darren reported but with less C code.

We copied one of the original "Create Bank*" UBE and prepared it for our needs.
We populated the long string APTA fields in F045720W table with our concatenated string(s). We used our custom "Convert Date to String Flexible" and "Convert Numeric to String Flexible" NER BSFNs for type conversions and formatting.
Our only C BSFN is which flushes the record from F045720W table to the text file.
The location and the name of the flat file comes from the processing options of our custom UBE.

On the other hand I totally agree with Darren's suggestions/oppinions.

As earlier write your flexible type conversion as better it is for the future.

Welcome aboard!

Zoltán



B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Had similar project where we were needing to submit a payroll 401k file to meet their specs. We used a standard UBE that wrote the information to string variables.
Every field (dates, amounts, and regular strings) were written to their own string variables.
This did two things: 1. Allowed for application of specific formatting to dates and amounts (like zero padding) 2. Ensured the specific field lenghts met the banks pre-defined criteria.
Once each and every field is written to string variables you have two options: 1. If the total length of the fields are less than 255 you may concatenate into one field and perform database output to a text file using just the one field. 2. If the length exceeds 255 then each field individually is listed in the database output setup.
Once in a text file, you have a great amount of flexibility to use in MS Excel or any other tool desired. Hope this helps.

OW 14.1 - AS/400 - Citrix - NT2000
 

Zoltan_Gyimesi

Legendary Poster
Hi "cworly",

If you are on B7332 or later than take a look at the Business Functions in B34A1010 source Module (Open Flat File, Close Flat File, Write One Line To Flat File). The output string (based on VAR1 data item) could be 5000 char long. The CR-LF line terminator characters will be appended automatcally by "Write One Line To Flat File". The attachments of these functions are exceptionally usable.

In earlier versions take a look at the B0500025 "Export To Flat File" business function. This won't append CR-LF but you can use B7400150 "Convert CR And LF to hexadecimal" business function to produce the codes into char variables and concatenate them to the end of your output string. These are exist under B7331 but I amn't sure that they do prior B7331.

Regards,
Zoltán



B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Top