HiLMAs reference
Back

String Handling

Next

PARSE

PARSE string,WITH,str1,str2,str3,...[,SEP='character'][,SEPMODE=M/S]

 

Description

string is divided in its words, that are put in str1, str2, etc.; separation character is blank, and can be changed using SEP=  with the new character enclosed in quotes.

SEPMODE= change the parsing mode of this instruction: with SEPMODE=M (Multiple, the default) more sequenced separation characters are considered separing only two words (this is ordinary if space is the separator); with SEPMODE=S (Single) a separation character is ever between two words; so two or more sequenced separation character are dividing one or more empty words; an empty word in Hilmas is a string filled with spaces. SEPMODE=S can be used with SEP=',' to read and separe a typical parameter string used in JCL, where separator is comma and where ',,' denote a skipped positional parameter.

The parsing rules are:

 

 

Parameter specifications

Parameter Name Mode Type coding Remark
1 string Input  String C or X String to be overlayed; max length 255 char.
2 WITH fixed word     A self explaining separator
3 str1 Output String C or X Will contain the first word in input string
4 str2 Output String C or X Will contain the second word in input string
5 str3 Output String C or X Will contain the third word in input string
  up to 20 Output strings Will contain the other words in input string
  SEP='c' Input Constant    
  SEPMODE=S
SEPMODE=M
Input Constant
M or S
   

 

Examples

 


Back Start Next
ROUTINE Top SUBSTR