View previous topic :: View next topic
|
Author |
Message |
srj1957
New User
Joined: 15 Dec 2005 Posts: 72 Location: RALEIGH NC, USA
|
|
|
|
Hi everyone,
Another day, another challenge...
I want to extract portion of data from records where blank occurs after a certain position, in this case first blank after position 10.
INPUT FILE
000020145 AXID NIZATIDINE CAPSULES
000020202 NORTRIPTYLINE HYDROCHLORIDE SO
000020203 OPIUM TINCTURE USP
000020210 BYETTA INJECTION KIT
000020303 AMYTAL SODIUM INJECTION USP
000020329 V-CILLIN K TABLETS USP
OUTPUT
000020145 AXID
000020202 NORTRIPTYLINE
000020203 OPIUM
000020210 BYETTA
000020303 AMYTAL
000020329 V-CILLIN
Hope ya'll can help on this..
Thanks
Steve |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Steve,
"Parse" can be used to get delimited fields from Input file. Check out this link and look for "Extract and justify delimited fields" in the document on how to use this function.
In your case " " (Space) can be used as a delimiter, and extract first field only while BUILD the output record. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. It looks like the field you want starts in posiiton 12 rather than position 10, so that's what I assumed, but you can change ABSPOS to wherever it starts. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE and %nn functions. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Use [URL] BBCode for External Links
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
000020145 AXID NIZATIDINE CAPSULES
000020202 NORTRIPTYLINE HYDROCHLORIDE SO
000020203 OPIUM TINCTURE USP
000020210 BYETTA INJECTION KIT
000020303 AMYTAL SODIUM INJECTION USP
000020329 V-CILLIN K TABLETS USP
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(ABSPOS=12,ENDBEFR=C' ',FIXLEN=20)),
BUILD=(1,11,12:%01)
/*
|
|
|
Back to top |
|
|
srj1957
New User
Joined: 15 Dec 2005 Posts: 72 Location: RALEIGH NC, USA
|
|
|
|
priyesh.agrawal and Frank Yaeger
Excellent....thanks for your help... |
|
Back to top |
|
|
|