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
 

 

replacind two or more strings using IFTHEN in JCL

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

New User


Joined: 20 Feb 2007
Posts: 16
Location: New York

PostPosted: Tue Mar 13, 2007 12:25 pm    Post subject: replacind two or more strings using IFTHEN in JCL
Reply with quote

Hi,

I have around 90 fields in my file which are signed numeric, i want to replace space with + for numeric field only. The file is of 3200 bytes having other datatypes too.

I am using following jcl

Code:

//SORTSTP2 EXEC PGM=SORT,PARM='DYNALLOC'             
//SYSPRINT DD  SYSOUT=*                                   
//SYSOUT   DD  SYSOUT=*                                   
//SORTIN   DD  DSN=TOP1.COMOD.FSL601A.D0313.DT,DISP=SHR   
//SORTOUT  DD  DSN=TOP1.COMOD.FSL601A.D0313.DT1,         
//            DISP=(NEW,CATLG,DELETE),                   
//           UNIT=SYSDA,                                 
//            DCB=*.SORTIN,                               
//           SPACE=(100,(100,100),RLSE)                   
//SYSIN    DD  *                                         
*  PUT SPECIAL KEY OF '+' IN PLACE OF ' ' IN THE RECORD. 
  INREC  IFTHEN=(WHEN=(10,1,CH,EQ,C' '),OVERLAY=(10:C'+')),
        IFTHEN=(WHEN=(27,1,CH,EQ,C' '),OVERLAY=(27:C'+')),
        IFTHEN=(WHEN=(44,1,CH,EQ,C' '),OVERLAY=(44:C'+')),
        IFTHEN=(WHEN=(61,1,CH,EQ,C' '),OVERLAY=(61:C'+')),
        IFTHEN=(WHEN=(78,1,CH,EQ,C' '),OVERLAY=(78:C'+')),
        IFTHEN=(WHEN=(95,1,CH,EQ,C' '),OVERLAY=(95:C'+'))
        SORT FIELDS=COPY       
        OUTREC FIELDS=(1,3122) 
//
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: Tue Mar 13, 2007 8:44 pm    Post subject:
Reply with quote

Are you asking how to use IFTHEN to make multiple changes to the same record for different fields? If so, then the answer is to use the HIT=NEXT parameter. Without HIT=NEXT, DFSORT stops when the IFTHEN condition is satisfied. With HIT=NEXT, DFSORT continues to the next IFTHEN clause.

Code:

  INREC IFTHEN=(WHEN=(10,1,CH,EQ,C' '),OVERLAY=(10:C'+'),HIT=NEXT),
        IFTHEN=(WHEN=(27,1,CH,EQ,C' '),OVERLAY=(27:C'+'),HIT=NEXT),
        ...
        IFTHEN=(WHEN=(95,1,CH,EQ,C' '),OVERLAY=(95:C'+'))
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 Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts IFTHEN to reformat the matching and n... maki_psg SYNCSORT 6 Fri Sep 25, 2015 2:53 pm
No new posts OUTREC with IFTHEN Query... mkk157 DFSORT/ICETOOL 1 Wed Aug 26, 2015 5:17 pm


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