Page 1 of 1

need to delimit by spaces

PostPosted: Wed May 27, 2009 4:54 pm
by goldvel
I have an input file which has first name and last name, which was seprated by spaces.

i need first name alone. (ie.. i need the all the characters till it encounters spaces.)

Example.

Input File:

David Smith
Fremid John

output file:

David
Fremid

Thanks,
Goldvel

Re: need to delimit by spaces

PostPosted: Wed May 27, 2009 9:47 pm
by skolusu
goldvel,

use the following JCL
//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
DAVID SMITH                                             
FREMID JOHN                                             
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC PARSE=(%00=(ENDBEFR=C' ',FIXLEN=20)),BUILD=(%00)
/*                                                       


The output will be a 20 byte firstname.