Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Extract word from '_'

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Tue Feb 23, 2010 2:07 pm    Post subject: Extract word from '_'
Reply with quote

I try to extract a word from this character : '_'. I guess PARSE can do it, but how to go back on the record (there's no "GOBCKAT"=BLANKS) ?

(FB=80)

Code:
AAAA U V001_X_Y LLLLLLLLLLLLLL
A V1_Z OOOOO LLLLLLLLLLLLLLLLLLLL
VVVVVVVVVVV xxxx zz V2_CCC_PPP ZZZZZZZZ


must give :
V001_X_Y
V1_Z
V2_CCC_PPP
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Feb 23, 2010 5:40 pm    Post subject:
Reply with quote

Hi,

here is one way of getting the result
Code:
//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                               
AAAA U V001_X_Y LLLLLLLLLLLLLL               
A V1_Z OOOOO LLLLLLLLLLLLLLLLLLLL             
VVVVVVVVVVV XXXX ZZ V2_CCC_PPP ZZZZZZZZ       
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                               
  SORT FIELDS=COPY                           
 INREC PARSE=(%00=(ENDBEFR=C' ',FIXLEN=20),   
              %01=(ENDBEFR=C' ',FIXLEN=20),   
              %02=(ENDBEFR=C' ',FIXLEN=20),   
              %03=(ENDBEFR=C' ',FIXLEN=20),   
              %04=(ENDBEFR=C' ',FIXLEN=20)), 
        BUILD=(%00,%01,%02,%03,%04)           
    OUTREC IFTHEN=(WHEN=(1,20,SS,EQ,C'_'),   
                 BUILD=(1,20)),               
           IFTHEN=(WHEN=(21,20,SS,EQ,C'_'),   
                 BUILD=(21,20)),                   
           IFTHEN=(WHEN=(41,20,SS,EQ,C'_'),       
                 BUILD=(41,20)),                   
           IFTHEN=(WHEN=(61,20,SS,EQ,C'_'),       
                 BUILD=(61,20)),                   
           IFTHEN=(WHEN=(81,20,SS,EQ,C'_'),       
                 BUILD=(81,20))                   
/*                                                 



Gerry
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
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
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 Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us