Good afternoon,
May I please ask for the following:
....
07 IN1 PIC X(20) VALUE "701 STREET DR "
07 in2 PIC X(15) value "nEW yORK cITY "
07 in3 PIC X(10) VALUE "SOME "
07 OUT PIC X(60).
I need to do a simple thing: to conc atinate IN1 + spase + IN2 + space + IN3 to receive in OUT
"701 STREET DR nEW yORK cITY SOME "
When I'm using STRING... DELIMITED BY space-> it trimmed all spaces
I can filnd the length od each string and take a substring, for instance
IN1(1:length of IN1) -> DOES NOT GIVE ME A LOT, how to put them all in OUT???...
All IN1,2,3 can not be variable length-they are coming from the Input file,fixed length..
Appreciate your help.
Thanking in advance,
Concat String fields delimiter spaces
-
- Posts: 27
- Joined: Thu Feb 21, 2008 6:42 pm
- Skillset: pl/1,cobol.CICS,db2,ims,VSAM..etc
- Referer: search on teh Internet
Re: Concat String fileds delimiter spaces
Try string delimited by two spaces......
-
- Posts: 27
- Joined: Thu Feb 21, 2008 6:42 pm
- Skillset: pl/1,cobol.CICS,db2,ims,VSAM..etc
- Referer: search on teh Internet
Re: Concat String fileds delimiter spaces
Thank you for review..
Tried. It trims all spaces anyway...
STRING
IN1 " "
IN2 " "
IN3 " "
DELIMITED BY SPACE
INTO OUT
gives OUT as
"701STREETDRnEWyORKcITYSOME"
I think ,the keyword is here "DELIMITED BY SPACE " - it just omit all the spaces everywhere in the fields...
Thank you,
Tried. It trims all spaces anyway...
STRING
IN1 " "
IN2 " "
IN3 " "
DELIMITED BY SPACE
INTO OUT
gives OUT as
"701STREETDRnEWyORKcITYSOME"
I think ,the keyword is here "DELIMITED BY SPACE " - it just omit all the spaces everywhere in the fields...
Thank you,
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Concat String fileds delimiter spaces
Hello,
UseNote that there are 2 spaces between the quotes (per CG's suggestion).
Use
Code: Select all
DELIMITED BY ' '
Hope this helps,
d.sch.
d.sch.
-
- Posts: 27
- Joined: Thu Feb 21, 2008 6:42 pm
- Skillset: pl/1,cobol.CICS,db2,ims,VSAM..etc
- Referer: search on teh Internet
Re: Concat String fileds delimiter spaces
Thank you very much, everyone.
Put 2 spaces instead of one-the result is much better (thanks!):
"701 STREET DRnEW yORK cITYSOME"
modified delimiter between fields to ','
STRING
IN1 ", "
IN2 ", "
IN3 ", "
DELIMITED BY ' '
INTO OUT
and got
"701 STREET DR,nEW yORK cITY,SOME" -> looks much better
the only problem now: if first fields are empty-> i would get
,,, ->leading "," - but it could be fixed by programming- need to check before STRING...
Thank you very much, Mr. Cics Guy and Mr. Dick Scherrer
Put 2 spaces instead of one-the result is much better (thanks!):
"701 STREET DRnEW yORK cITYSOME"
modified delimiter between fields to ','
STRING
IN1 ", "
IN2 ", "
IN3 ", "
DELIMITED BY ' '
INTO OUT
and got
"701 STREET DR,nEW yORK cITY,SOME" -> looks much better
the only problem now: if first fields are empty-> i would get
,,, ->leading "," - but it could be fixed by programming- need to check before STRING...
Thank you very much, Mr. Cics Guy and Mr. Dick Scherrer
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Concat String fileds delimiter spaces
You're welcome - good luck
d

d
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 3826
-
by sergeyken
View the latest post
Thu Mar 25, 2021 7:12 pm
-
-
Replace a string with another string with different length
by Devrana » Sun Jan 19, 2025 3:23 pm » in JCL - 1
- 1646
-
by sergeyken
View the latest post
Sun Jan 19, 2025 11:07 pm
-
-
-
Add a string depending on pattern
by Prasanna G » Mon Jul 05, 2021 8:48 am » in DFSORT/ICETOOL/ICEGENER - 1
- 1345
-
by Prasanna G
View the latest post
Mon Jul 05, 2021 11:07 am
-
-
- 3
- 5894
-
by sergeyken
View the latest post
Sat Dec 10, 2022 2:30 am
-
- 4
- 2243
-
by sergeyken
View the latest post
Mon Jun 26, 2023 12:56 am