Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.39.7 Data Flow



When the UNSTRING statement is initiated, data is transferred from the sending field to the current data receiving field, according to the following rules:

Stage 1: Examine

  1. If the POINTER phrase is specified, the field is examined, beginning at the relative character position specified by the value in the pointer field.
    
    
    If the POINTER phrase is not specified, the sending field character-string is examined, beginning with the leftmost character.
    
    
  2. If the DELIMITED BY phrase is specified, the examination proceeds from left to right, character-by-character, until a delimiter is encountered. If the end of the sending field is reached before a delimiter is found, the examination ends with the last character in the sending field. If there are more receiving fields, the next one is selected; otherwise, an overflow condition occurs.
    
    
    If the DELIMITED BY phrase is not specified, the number of characters examined is equal to the size of the current data receiving field, which depends on its data category, as shown in Table 41 in topic 6.2.21.6.
    
    
    
    
     Table 50. Characters examined when DELIMITED BY is not specified          
                                         
     IF the receiving field is...        
     THEN the number of characters       
     examined is...                      
     alphanumeric or alphabetic          
                                         
     equal to the number of characters   
     in the current receiving field      
     numeric                             
                                         
                                         
     equal to the number of characters   
     in integer portion of the current   
     receiving field                     
     described with the SIGN IS SEPARATE 
     clause                              
     1 less than the size of the current 
     receiving field                     
     described as a variable-length data 
     item                                
                                         
     determined by the size of the       
     current receiving field at the      
     beginning of the UNSTRING operation 
    
    

    
    

    Stage 2: Move
    
    
  3. The examined characters (excluding any delimiter characters) are treated as an alphanumeric elementary item, and are moved into the current data receiving field, according to the rules for the MOVE statement (see "MOVE Statement" in topic 6.2.24).
    
    
  4. If the DELIMITER IN phrase is specified, the delimiting characters in the sending field are treated as an elementary alphanumeric item and are moved to the current delimiter receiving field, according to the rules for the MOVE statement. If the delimiting condition is the end of the sending field, the current delimiter receiving field is filled with spaces.
    
    
  5. If the COUNT IN phrase is specified, a value equal to the number of examined characters (excluding any delimiters) is moved into the data count field, according to the rules for an elementary move.
    
    

    Stage 3: Successive Iterations
    
    
  6. If the DELIMITED BY phrase is specified, the sending field is further examined, beginning with the first character to the right of the delimiter.
    
    
    If the DELIMITED BY phrase is not specified, the sending field is further examined, beginning with the first character to the right of the last character examined.
    
    
  7. For each succeeding data receiving field, this process of examining and moving is repeated until either of the following occurs:
    
    
    • All the characters in the sending field have been transferred.
    • There are no more unfilled data receiving fields.
      
      

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.