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

replacind two or more strings using IFTHEN in JCL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Mar 13, 2007 8:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Cant find hex value using IFTHEN=(WHEN DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. How to search multiple strings in a PDS IBM Tools 3
No new posts IFTHEN : Is there a better way? DFSORT/ICETOOL 7
No new posts Print next line strings when a condit... DFSORT/ICETOOL 9
Search our Forums:

Back to Top