IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Find blank position in record and extract that field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Thu Nov 16, 2006 10:10 pm
Reply with quote

Hi everyone,
Another day, another challenge... icon_wink.gif

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Nov 16, 2006 11:03 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 16, 2006 11:23 pm
Reply with quote

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
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Fri Nov 17, 2006 12:19 am
Reply with quote

priyesh.agrawal and Frank Yaeger

Excellent....thanks for your help... 2014.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top