Link to home
Start Free TrialLog in
Avatar of NOENIMIES
NOENIMIES

asked on

NEED TO REMOVE SPACE BEFORE THE TAB DELIMITER

THE CODE ATTACHED INSERTS THE TAB CHARACTER BEWTEEN THE FIELDS BUT IT IS PRECEEDED BY A SPACE (IT ACTUALLY TURNS OUT TO BE X"0009".
HOW DO I ELIMINATE THE SPACE?
Avatar of garypfirstech
garypfirstech

You're including FIELD-1 by size.  It seems that perhaps the non-null characters in FIELD-1 are one character less than the actual size of FIELD-1 so the trailing character in FIELD-1 is X'00'.  Try changing DELIMITED BY SIZE to DELIMITED BY X'00' and see if that corrects your issue.
Avatar of Bill Prew
How are field-1 and field-2 defined?

~bp
Avatar of NOENIMIES

ASKER

Defined as PIC X.
I also tried to redefine as s9 display, neither worked
Sorry I misunderstood, the fields in the string are PIC X or literals
01  HEX-09-CREATE.
    02  FILLER        VALUE +09          PIC S9(02) COMP.
01  HEX-09X REDEFINES HEX-09-CREATE.
    02  HEX-09                           PIC X(01).
    02  FILLERXX                         PIC X(01).

Put the above code in Working Storage, then in the Procedure Division simply
                  MOVE HEX-09                  TO SOME-FIELD.

I found the abov eon your WEBSITE but it doesn't work either....
On Line 4 you spelled SIZE wrong.
that was pseudo code to make the illustration,  the actual code has no compiler errors
What is the exact entry in the data division for field-1 (including its picture) and what value does field-1 have at the start of the STRING statement?
...the fields in the string are PIC X or literals

I don't quite understand that statement. If it's a "field", then it can't also be a "literal". Which is it?

The actual STRING statement and the data definitions are needed. Pseudo-code isn't useful here.

What platform are you compiling on? What compiler are you running?

Tom
cobol32 on windows/xp
micro focus..not fujitsu

Did you try it this way?:

01  HEX-09-CREATE.
    02  FILLER        VALUE +09          PIC S9(02) COMP.
01  HEX-09X REDEFINES HEX-09-CREATE.
    02  FILLERXX                         PIC X(01).
    02  HEX-09                           PIC X(01).

Open in new window

FWIW, I don't see any code attached to the first post, but it seems like others do, so maybe it's just me somehow.

 James
I don't see any code attached to the first post...

I see a data definition; but so far there is no code to show what is being done, as far as I can see. That would explain some confusion that I have. I simply can't see any attached code.

Tom
BTW, note that X"0009" is a valid (Unicode) value for a (horizontal) TAB character.

Tom
ASKER CERTIFIED SOLUTION
Avatar of NOENIMIES
NOENIMIES

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.