Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Find blank position in record and extract that field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Find blank position in record and extract that field
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: 1452
Location: Chicago, IL

PostPosted: Thu Nov 16, 2006 11:03 pm    Post subject: Re: Find blank position in record and extract that field
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 Moderator


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

PostPosted: Thu Nov 16, 2006 11:23 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us