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 Profile Log in to check your private messages Log in
 
Using IFTHEN to modify just one field in output

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

New User


Joined: 01 Jun 2009
Posts: 9
Location: India

PostPosted: Tue May 25, 2010 7:45 pm    Post subject: Using IFTHEN to modify just one field in output
Reply with quote

Hi,

I am trying a simple thing, just moving some fields from input file to output file, the only logic to apply is to check if one field in input is 'M' or 'F' then concatenate two input fields to last output field. Following is the sort card that I am trying to use but getting different errors mostly syntax error.

Code:

SORT FIELDS=COPY                                                 
OUTREC BUILD=(27,3,C'!',1,10,SQZ=(SHIFT=LEFT),C'!',             
              30,10,SQZ=(SHIFT=LEFT),C'!',                       
              590,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',       
              604,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',       
              620,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',       
              626,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',       
              632,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',       
              127,15,C'!',142,20,C'!',537,40,C'!',               
              498,1,C'!',584,6,SQZ=(SHIFT=LEFT),C'!',           
              170,30,C'!',200,30,C'!',230,30,C'!',260,30,C'!',   
              320,3,C'!',323,9,C'!',1358,1,C'!',                 
              1359,1,C'!',1360,1,C'!',1361,9,C'!',               
              1370,16,C'!',113,1,C'!',96,1,C'!',                 
              40,8,C'!',64,8,C'!',56,8,C'!',371:X               
       IFTHEN=(WHEN=(498,1,CH,EQ,C'M',OR,498,1,CH,EQ,C'F'),     
       OVERLAY=(371:142,20,391:127,15)))                         


I think this can be achieve if I use IFTHEN with BUILD twice, but just want to know if it is possible the way I am trying as above, or is there any other efficient way.

Thanks,
Manu
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue May 25, 2010 10:18 pm    Post subject: Reply to: Using IFTHEN to modify just one field in output
Reply with quote

Manu Dhawan,

With OUTREC build you have already moved the contents of 498 to pos 160. You also moved the contents of 127 and 142 to 82 and 98 respectively. So you cannot really use the same position as your input on the IFTHEN statement. Try these updated control cards.

Code:

//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  OUTREC IFTHEN=(WHEN=INIT,                                   
  BUILD=(0027,3,C'!',1,10,SQZ=(SHIFT=LEFT),C'!',             
         0030,10,SQZ=(SHIFT=LEFT),C'!',                       
         0590,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',         
         0604,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',         
         0620,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',         
         0626,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',         
         0632,6,PD,EDIT=(SIIIIIT.TT),SIGNS=(,-),C'!',         
         0127,15,C'!',142,20,C'!',537,40,C'!',               
         0498,1,C'!',584,6,SQZ=(SHIFT=LEFT),C'!',             
         0170,30,C'!',200,30,C'!',230,30,C'!',260,30,C'!',   
         0320,3,C'!',323,9,C'!',1358,1,C'!',                 
         1359,1,C'!',1360,1,C'!',1361,9,C'!',                 
         1370,16,C'!',113,1,C'!',96,1,C'!',                   
         0040,8,C'!',64,8,C'!',56,8,C'!',371:X)),             
  IFTHEN=(WHEN=(160,1,CH,EQ,C'M',OR,160,1,CH,EQ,C'F'),       
  OVERLAY=(371:98,20,391:82,15))                             
//*
Back to top
View user's profile Send private message
Manu Dhawan

New User


Joined: 01 Jun 2009
Posts: 9
Location: India

PostPosted: Wed May 26, 2010 11:24 am    Post subject: Reply to: Using IFTHEN to modify just one field in output
Reply with quote

Hi Skolusu,

It worked.

Thank you,
Manu
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

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