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 Usergroups Profile Log in to check your private messages Log in
 

 

Use of OVERLAY with IFTHEN and OUTREC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Use of OVERLAY with IFTHEN and OUTREC
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 Moderator


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

PostPosted: Tue Sep 19, 2006 9:08 pm    Post subject:
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    Post subject: Re: Use of OVERLAY with IFTHEN and OUTREC
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 Moderator


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

PostPosted: Tue Sep 19, 2006 11:03 pm    Post subject:
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    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 Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am


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