IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is the use of cobol scope terminator STRING END-STRING?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
niharika1234

New User


Joined: 01 May 2006
Posts: 9

PostPosted: Tue May 02, 2006 2:28 pm
Reply with quote

HI All!

What is the use of cobol scope terminator STRING END-STRING?
And what does the following code mean?

Code:
STRING 'OPEN DATEFILE ERROR, FILE STATUS = '
                                                       DELIMITED BY SIZE
             WS-DATEFILE-FILE-STATUS  DELIMITED BY SIZE
     INTO SPZC-TEXT1
END-STRING

Thanks..................
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue May 02, 2006 2:52 pm
Reply with quote

niharika,

STRING is a COBOL verb, you can use to merge two or more strings to one.

END-STRING, as you already said, is scope terminator for the corresponding STRING verb, which makrs an end of the statement too there.

The code you mentioned will join the two strings resulting into SPZC-TEXT1.

Thus SPZC-TEXT1 would be having 'OPEN DATEFILE ERROR, FILE STATUS = ' and value of WS-DATEFILE-FILE-STATUS in it.

Regards,
Priyesh.
Back to top
View user's profile Send private message
niharika1234

New User


Joined: 01 May 2006
Posts: 9

PostPosted: Tue May 02, 2006 2:55 pm
Reply with quote

Priyesh!

what does "DELIMITED BY SIZE " mean?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue May 02, 2006 3:01 pm
Reply with quote

Quote:
what does "DELIMITED BY SIZE "?


DELIMITED BY SIZE specifies:
All the contents of source-string would be moved to destination-string in the same sequence in which they appear in the statement.
Data movement begins with the leftmost character and continues to the right, character by character.
Data movement ends when the STRING operation has transferred all data in each source-string or reaches the end of dest-string

For a complete information on STRING statement, you can also visit MANUALS...

Regards,
Priyesh.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top