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

Use of OVERLAY with IFTHEN and OUTREC


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

New User


Joined: 19 Sep 2006
Posts: 4
Location: Milwaukee Wi

PostPosted: Tue Sep 19, 2006 6:53 pm
Reply with quote

I am trying modify a ZD field to zero when the summed value is less than zero. I am using an "IFTHEN" clause with an "OVERLAY". I have searched for examples of how this might work but continue to get syntax errors whne trying to add this logic.

I have the following code that works below (See Attachment). I am trying to insert the additional logic of :

IFTHEN=(WHEN=(064,09,ZD,LT,0), OVERLAY=(064:0,9,ZD)

Can you advise me on how this code can be added, or if there is a better way to accomplish this task.

Any help would be appreciated.

Rockw83

Code:

//SYSIN    DD *                               
   OPTION ZDPRINT                               
   INREC FIELDS=(1,162,163:C'~')               
   SORT FIELDS=(001,19,CH,A,                   
                          073,06,CH,A)                   
   SUM FIELDS=(046,09,ZD,                       
                        055,09,ZD,                       
                        064,09,ZD)                   
   OUTFIL FNAMES=COMBINE,                       
          OUTREC=(001,19,163,1,                 
                         020,19,163,1,                 
                         073,06,163,1,                 
                         046,09,ZD,M0,LENGTH=9,163,1, 
                         055,09,ZD,M0,LENGTH=9,163,1, 
                         064,09,ZD,M0,LENGTH=9,163,1,  <------
                         079,02,                       
                         081,04,163,1,                 
                         082,26)                 
 /*
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 Sep 19, 2006 9:08 pm
Reply with quote

Code:

  IFTHEN=(WHEN=(064,09,ZD,LT,0),OVERLAY=(064:0,9,ZD)


0,9,ZD is invalid and not the way to set the field to 0. You're getting a syntax error because you're giving a starting position of 0 for a 9 byte ZD field. To do what you want, you can add this control statement:

Code:

   OUTREC IFTHEN=(WHEN=(64,9,ZD,LT,0),         
            OVERLAY=(64:+0,TO=ZD,LENGTH=9))   


Note that OUTREC is processed after SUM and before OUTFIL.
Back to top
View user's profile Send private message
Rockw83

New User


Joined: 19 Sep 2006
Posts: 4
Location: Milwaukee Wi

PostPosted: Tue Sep 19, 2006 9:38 pm
Reply with quote

Thank you for your quick reply. I added the code and it works great. I appreciate your time.

Rockw83
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 Sep 19, 2006 11:03 pm
Reply with quote

Glad I could help.
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 question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
No new posts Cant find hex value using IFTHEN=(WHEN DFSORT/ICETOOL 12
Search our Forums:

Back to Top