Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to concatenate string on Micro Focus Cobol (Unix) !

Status
Not open for further replies.

Acadian

Programmer
Aug 10, 2005
5
CA
On Open VMS, its worked well !

Part of my program :

IF FAMILIALE-COMPLETE OF INFILE1-REC = "Y"
CALL 'STR$CONCAT' USING BY DESCRIPTOR WS-OUTFILE1-REC
BY DESCRIPTOR DOCUMENT-ID OF WS-INFILE1-REC,
BY DESCRIPTOR "~~",
BY DESCRIPTOR WS-DT-EMIS-F,
BY DESCRIPTOR "~~",
BY DESCRIPTOR NO-POLICE OF WS-INFILE1-REC,
BY DESCRIPTOR "~~",
BY DESCRIPTOR NOM-ASSURE OF WS-INFILE1-REC,
 
STR$CONCAT is a VMS-specific function. I doubt it's available on your UNIX platform with MicroFocus??

If you have a lot of these calls, you might consider developing your own subroutine replacement for STR$CONCAT. Otherwize, I think you have to use STRING to accomplish this (and perhaps some other code to determine the length of the strings to concatenate).

Regards.

Glenn
 
Also, there is no "BY DESCRIPTOR" option (that I know of) for any Micro Focus compiler.

Bill Klein
 
And you may also play with the VarName(pos:length) syntax.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank 3gm, WMK and PHV for your information

We will take a look to the "VarName(pos:length)" fonction. Otherwise we will create our own fonction.

New Brunswick, Canada
 
Not knowing exactly what 'STR$CONCAT' does, I still don't know why you aren't using the "built-in" (native and STANDARD) STRING statement. My best guess (without knowing what that subroutine does is that:

CALL 'STR$CONCAT' USING
BY DESCRIPTOR WS-OUTFILE1-REC
BY DESCRIPTOR DOCUMENT-ID OF WS-INFILE1-REC,
BY DESCRIPTOR "~~",
BY DESCRIPTOR WS-DT-EMIS-F,
BY DESCRIPTOR "~~",
BY DESCRIPTOR NO-POLICE OF WS-INFILE1-REC,
BY DESCRIPTOR "~~",
BY DESCRIPTOR NOM-ASSURE OF WS-INFILE1-REC,

MAY BE equivalent to the (portable)

String
DOCUMENT-ID OF WS-INFILE1-REC delimited by size
"~~" Delimited by Size
WS-DT-EMIS-F delimited by size
"~~" delimited by size
NO-POLICE OF WS-INFILE1-REC delimited by size
"~~" delimited by size
NOM-ASSURE OF WS-INFILE1-REC delimited by size
into WS-OUTFILE1-REC

Bill Klein
 
I raised a topic concerning the creation of a CSV record.

I think some of the replies were very good, and you may find some himts to your final solution there.

thread209-1029633
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top