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

Negative value used in IFTHEN


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 51
Location: Taiwan

PostPosted: Tue Aug 04, 2015 2:12 pm
Reply with quote

I am trying to comparing two items and reformat the output based on the result.

The ICETOOL statements :
Code:
//S1 EXEC PGM=ICETOOL                                                   
//TOOLMSG   DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//T0 DD DSN=&&T0,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA             
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA             
//IN        DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
00095    00100                                                         
/*                                                                     
//TOOLIN DD *                                                           
  COPY FROM(IN) TO(T0) USING(CTL0)                                     
  COPY FROM(TO) TO(T1) USING(CTL1)                                     
/*                                                                     
//CTL0CNTL DD *                                                         
  OPTION COPY                                                           
  OUTFILE BUILD=(1:1,5,ZD,SUB,10,5,ZD,M26,LENGTH=5,80:X) 
/*                                                       
//CTL1CNTL DD *                                           
  OUTFIL IFTHEN(WHEN=(1,5,ZD,LE,0),                       
           BUILD=(C'AAA'))                               
/*                                                       


The content of the result
Code:
   Menu  Utilities  Compilers  Help                                             
  BROWSE    NBSDDSN2.TEMP.X102.SAMF                    Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> PAGE
********************************* Top of Data **********************************
00005                                                                           
******************************** Bottom of Data ********************************


Please advise how to manipuate a signed value as above in order to get the correct content "AAA"?

Code'd
Back to top
View user's profile Send private message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 51
Location: Taiwan

PostPosted: Tue Aug 04, 2015 2:31 pm
Reply with quote

It is likely that I figure out the solution:
Code:
//S1 EXEC PGM=ICETOOL                                                   
//TOOLMSG   DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//T0 DD DSN=&&T0,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA             
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA             
//IN        DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
00095    00100                                                         
/*                                                                     
//TOOLIN DD *                                                           
  COPY FROM(IN) TO(T0) USING(CTL0)                                     
  COPY FROM(TO) TO(T1) USING(CTL1)                                     
/*                                                                     
//CTL0CNTL DD *                                                         
  OPTION COPY                                                           
  OUTFILE BUILD=(1:1,5,ZD,SUB,10,5,ZD,EDIT=(STTTTT),SIGNS=(+,-),80:X) 
/*                                                       
//CTL1CNTL DD *                                           
  OUTFIL IFTHEN(WHEN=(1,5,SFF,LE,0),                       
           BUILD=(C'AAA'))                               
/*                                                       


Any comment?

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 04, 2015 3:13 pm
Reply with quote

You haven't said what it is you want to do. Whatever it is, it is unlikely that you need ICETOOL or two passes of the data.

Just an ordinary SORT step, with something like this may do what you want in full.

Code:
  OPTION COPY
                                     
  INREC IFTHEN=(WHEN=INIT,
                 BUILD=(1,5,ZD,
                       SUB,
                        10,5,ZD,
                         TO=ZD,
                         LENGTH=5,
                        80:X)),
        IFTHEN=(WHEN=(1,5,ZD,LE,0),
                 OVERLAY=(1:C'AAA',2X))
Back to top
View user's profile Send private message
jacobdng

New User


Joined: 27 Aug 2006
Posts: 51
Location: Taiwan

PostPosted: Wed Aug 05, 2015 7:23 am
Reply with quote

Bill,
Thank you. No more question.
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 Negative dependency between jobs in m... COBOL Programming 12
No new posts Cant find hex value using IFTHEN=(WHEN DFSORT/ICETOOL 12
No new posts Negative value - packed field - Natur... Java & MQSeries 0
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
Search our Forums:

Back to Top