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

String and Unstring


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Tue Feb 21, 2006 4:25 am
Reply with quote

I have some difficulty understanding how string and unstring works,
if someone can provides some examples that would be great
Thank you
Back to top
View user's profile Send private message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Tue Feb 21, 2006 4:27 am
Reply with quote

what parameters you need to specify and in which CICS tables you need to add those entries
Thank you
Fawzy
Back to top
View user's profile Send private message
smiley
Warnings : 1

New User


Joined: 08 Feb 2006
Posts: 27

PostPosted: Tue Feb 21, 2006 10:21 am
Reply with quote

Quote:
I have some difficulty understanding how string and unstring works,if someone can provides some examples that would be great



A STRING statement may be used to combine several fields to one field.

eg:-
Code:

05   NAME.
10  LAST-NAME     PIC X(10) VALUE ?EDISON?.
10  FIRST-NAME     PIC X(10) VALUE ?THOMAS?.
10  MIDDLE-NAME    PIC X(10) VALUE ?ALVA?.
01   NAME-OUT      PIC X(33).

   STRING
      FIRST-NAME DELIMITED BY ? ?
      ? ? DELIMITED BY SIZE
      MIDDLE-NAME DELIMITED BY ? ?
      ? ? DELIMITED BY SIZE
      LAST-NAME DELIMITED BY ? ?
      ? ? DELIMITED BY SIZE
      INTO NAME-OUT.


Output

Code:

   
   NAME-OUT = THOMAS ALVA EDISON


UNSTRING:

The UNSTRING statement may be used to convert keyed data to a more
compact form for storing it on disk.

Code:
MOVE ?THOMAS,ALVA,EDISON? TO NAME-OUT.
UNSTRING NAME-OUT
   DELIMITED BY ?,?
   INTO FIRST-NAME
      MIDDLE-NAME
      LAST-NAME.


OUTPUT:

Code:


FIRST-NAME = THOMAS
MIDDLE-NAME = ALVA
LAST-NAME = EDISON
Back to top
View user's profile Send private message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Tue Feb 21, 2006 10:35 am
Reply with quote

Thank you
That was helpful
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top