View previous topic :: View next topic
|
Author |
Message |
gaps030980
New User
Joined: 27 Sep 2005 Posts: 8 Location: Gurgaon
|
|
|
|
I have an input file having first name a space followed by the last name. The max combined length is 20 char. I need to pull up the first name and store it separately to a 2nd file and extract the last name and store it separately to a 3rd file. How do I do that using a JCL/SORT? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Can you post here the sort product info.(DFSORT/Syncsort) with the version nbr. See the SYSOUT of any job run to find this info. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Kushal,
You can use a DFSORT job like the following to do what you asked for.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ALFRED SMITH
WILLIAM JONES
JOE PLUMBER
GEORGE WASHINGTON
/*
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,
PARSE=(%01=(ENDBEFR=C' ',FIXLEN=20)),
BUILD=(%01)
OUTFIL FNAMES=OUT2,
PARSE=(%=(ENDBEFR=C' '),
%02=(FIXLEN=20)),
BUILD=(%02)
/*
|
OUT1 would have:
Code: |
ALFRED
WILLIAM
JOE
GEORGE
|
OUT2 would have:
Code: |
SMITH
JONES
PLUMBER
WASHINGTON
|
For complete details of DFSORT's PARSE function, see:
www.ibm.com/systems/support/storage/software/sort/mvs/peug/ |
|
Back to top |
|
|
|