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
 
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

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