Line Feed in a Custom Text File

DawgGoneIt

Member
I am creating an 1800 character record text file. The vendor says that the records in the file are not 1800 characters. I used variables that I lpad with spaces to make up the fillers for the 1800 characters and thought that I was getting 1800 characters. Also, they want a line feed after each row.

How do I ensure the 1800 characters?

How do I code the line feed? Do I just append an "LF" at the end of the text string?
confused.gif
 
Dawg,

We need your system configuration, before answering the question.
We need to know what you are using (functions) to write the string.

In short:
- Right Pad the string with 1800 spaces =D
- Substring the first 1800 characters
- write what you substrung to the flat file

Depending on your system, Unicode and other issue - you may be presenting only have the issue to us.

(db)
 
Running Xe 8.12
Do I have to put quotes areound all the string fields to get them to work? My filler fields are just not populating in the file.
I am using B34A1010 to write the file.
 
[ QUOTE ]
Running Xe 8.12

[/ QUOTE ]

??

If you're on 8.12, your output is likely unicode output which means each output character is 2 bytes in length...could that be what is tripping up your vendor?
 
Did you try using B0800207?.
Concat the variable at the end of the string.
 
I am not sure what you mean by concat the variable at the end of the string? Is this for the line feed? If so, what's the value in the variable?
 
No I don't think that is the issue. If I concat a variable to the text string it does not add it to the text string; e.g. VA rpt_Filler12345_AA05 that was set to the value '12345'. But if I concat "12345" it adds the 12345 to the file string.

The problem is that I obviously cannot know what the physical data is of every field and I have fillers of 100 blanks - which i rpad a variable string of 100 with blanks and then concat that in the record string. But it does not concat.

And I do not know what to use to produce an end-of-line feed.

confused.gif
confused.gif
confused.gif
 
Ok - it is Xe B7333 - I'm confusing my current life with my past life. . . sorry!
frown.gif
 
No I have not tried that BSFN. But my real issue at this point is getting the data string created - it does not concat my data in the string and I cannot figure out why???

Please -- if there is anyone out there that has created a fixed length field and record flat file in JD Edwards can you help?
crazy.gif
crazy.gif
 
Dawggie,

Is this a windows verses unix thing - Windows ends a line with a Carriage Return (CR) and Line Feed (LF) character combination; Unix ends a line with LF only.

The GetNewLineCharacter business function in B0800207 may provide the Windows end-of-line CR and LF character combination. I can't remember the actual details, but when I was dealing with end-of-line in windows and unix this business function didn't do what I wanted.

The ConvertCRLFtoHex business function in B7400150 retrieves the CR and LF characters separately. I have used this business function to get the LF character to check for the end of a line on a unix system. The ConvertCRLFtoHex business function in B7400150 may be what you need.
 
Hi DawgGoneIt,

[ QUOTE ]
The problem is that I obviously cannot know what the physical data is of every field and I have fillers of 100 blanks - which i rpad a variable string of 100 with blanks and then concat that in the record string. But it does not concat.


[/ QUOTE ]

I am not sure, I understand clearly your problem. Would be great a snippet of your ER. (is suppose, it is a normal UBE, not a TC - am I right?

Just a shot in the dark:
If you build your output string in an RV Report Variable, than by my experience (on XE), trailing blanks will be alwyas truncated. If This is the scenario, than build your string in an ER Event Rule variable, instead of in RV.

I do not know, is it a help for you.

Regards,

Zoltán
 
Ditto to Zoltan's post. How can we help / debug your code if you don't show the code?!
 
No - not using a RV - building in the code:
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// . . . CURRENCY CODE = "840" -- US $$$
// POS 123 - 125
VA rpt_USBFill1746_USBF1746 = concat([VA rpt_USBFill1746_USBF1746],"840")
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// . . . Filler of 40 + 7 -- USER ID, BUSINESS UNIT, CUSTOMER TIN
// POS 126 - 172
VA rpt_USBFill1746_USBF1746 = concat([VA rpt_USBFill1746_USBF1746],rpad([VA rpt_Filler20_ELM01]," ",20))
VA rpt_USBFill1746_USBF1746 = concat([VA rpt_USBFill1746_USBF1746],rpad([VA rpt_Filler20_ELM01]," ",20))
VA rpt_USBFill1746_USBF1746 = concat([VA rpt_USBFill1746_USBF1746]," ")
//
 
Dawg,

Originally, I thought the issue might be related to the Carriage Return / Line feed issue, review at:
http://www.jdelist.com/ubb/showflat.php?Cat=0&Board=OWDEV&Number=175911
or
http://www.jdelist.com/ubb/showflat.php?Cat=0&Board=OWDEV&Number=169879

But, it looks more like you might be hitting an issue where the string isn't actually filled to 1800 characters.

I guess, since we don't have the actual format of the export we need to make some guesses.

For padding between append values, consider changing the logic to look more like:

VA rpt_USBFill1746_USBF1746 = rpad([VA rpt_USBFill1746_USBF1746]," ",20))

You don't have to concatenate a filler variable. You just pad to the end of the variable you are working with.

One of many ways to accomplish the goal - Create Custom DD Item, 1800 characters. You can write your data to the variable (concatenate, rpad, concatenate, rpad...), then RPad 1800 spaces to the end. Since the DD Item is only 1800, those values greater outside 1800 will drop off.

Feel free to call, if you want to discuss more. It might be a could topic for JDEResearc.Com.

(db)
 
Hi Daniel,

I have done what you suggested as far as doing the
rpad(x,' ',11) - but this does not seem to work. and if I put a zero in there instead of a blank I get nothing. I resorted to variables with a lenght of say 11 and assigned 11 physical zeros in the field. Then when I concat that I do get the 11 zeros. But I cannot do that with a field that is 1700 spaces.

I am going to go read the things you suggested.
 
Back
Top