TAB in Physical File-2

0 pts.
Tags:
RPG
If I have a file which is created with no DDS (only Record length), how can I insert a tab in this field when I write record into the file using RPG?
ASKED: February 20, 2006  2:57 AM
UPDATED: November 30, 2009  4:16 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Can you be a little more specific on what you are trying to do? If you know what position in the record you want you could always us %Subst.

===================================================

You put tabs into records the same way you put any character anywhere — use EVAL. Just like every other value, you specify what value you want along with where you want the value to go. How would you put the letter ‘A’ in the file? Do the same thing with a tab; it’s just another value.

All of that might be pointless though. Why put tabs into physical files when there are far better things to do with tabs? Put them into streamfiles where they’ll actually be useful.

Tom

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JoeRoss
    I would assign a constant the hex value of "tab" and use that.
    0 pointsBadges:
    report
  • WaltZ400
    Define a 1 byte character field and load the correct hexidecimal value for a horizontal or vertical tab into the field. Use this character field to substring into a position on the record you are creating. The EBCDIC hex values for horizonal and vertical tab are X'05' (zero-five) and X'0B' (zero-bee) resectively.
    655 pointsBadges:
    report
  • Kalice
    Hi, As I need to export the PF to a TXT file(which need to be TAB delimited) in PC , if I use the built-in transfer function in Client access , that will be no problem. However, I need to use the FTP function to transfer the file. Therefore, I want to create a file with RCDLEN(200), here is the sample of the record that I would like to write:- 1111(TAB)PARTNO.(TAB)QTY(TAB).... Is it possible? Or is there any other method I can use? Thanks for your help in advance
    0 pointsBadges:
    report
  • JPLamontre
    Waou ! what a so complex question for a so simple solution ! You simply have to write your file (a "normal" ie DDS file) with your RPG logic, then CPYTOIMPF the file to IFS ! you just have to carefully code the field separator : in your problem, it's *TAB. sorry for a sample, I have not my 400 under fingers.
    0 pointsBadges:
    report
  • TomLiotta
    If you're just going to put the physical file into a text file, why don't you put the tab into a text file in the first place and skip the physical file entirely? And why would you put tabs into fixed-length (200 chars) records anyway? Tabs and fixed-length records are almost logically mutually exclusive. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following