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
 

 

Combining BUILD and OVERLAY in one statement, just wondering

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 05, 2013 2:20 pm    Post subject: Combining BUILD and OVERLAY in one statement, just wondering
Reply with quote

Just wondering if it is possible.

The job below works fine, but just for experimentation, tried to do the build from 1 to 3451 and an overlay of the only position that needs to be changed. I couldn't find any examples of using the BUILD and OVERLAY together, and by trial and error of combining the two options have only met with errors icon_eek.gif

Not a problem if it isn't possible as the job I have already created works fine anyway.
Code:

ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1   

Code:

//SYSIN    DD *                                   
  OPTION   COPY                                   
                                                   
  JOINKEYS FILE=F1,FIELDS=(1,12,A)                 
  JOINKEYS FILE=F2,FIELDS=(1,12,A),SORTED,NOSEQCK 
                                                   
  JOIN UNPAIRED,F1,F2                             
                                                   
  REFORMAT  FIELDS=(F2:1,3451,?)                   
                                                   
  OUTREC IFTHEN=(WHEN=(3452,1,CH,EQ,C'B'),         
            BUILD=(1,3447,C'A',3449,3)),           
         IFTHEN=(WHEN=(3452,1,CH,EQ,C'2'),         
            BUILD=(1,3451))                       
/*                                                 
//JNF1CNTL DD *                                   
***  DELETE DUPS FROM JNF1 INPUT FILE
  SUM FIELDS=NONE                                 
/*                                                 


One of the options tried was this one. Also swapping the order of the two options around didn't work either.
Code:

  OUTREC IFTHEN=(WHEN=(3452,1,CH,EQ,C'B'), 
            OVERLAY(3447:C'A'),             
            BUILD=(1,3451)),               
         IFTHEN=(WHEN=(3452,1,CH,EQ,C'2'), 
            BUILD=(1,3451))                 

Error from the code above
Code:

            OPTION   COPY                                                       
                                                                               
            JOINKEYS FILE=F1,FIELDS=(1,12,A)                                   
            JOINKEYS FILE=F2,FIELDS=(1,12,A),SORTED,NOSEQCK                     
                                                                               
            JOIN UNPAIRED,F1,F2                                                 
                                                                               
            REFORMAT  FIELDS=(F2:1,3451,?)                                     
                                                                               
            OUTREC IFTHEN=(WHEN=(3452,1,CH,EQ,C'B'),                           
                      OVERLAY(3447:C'A'),                                       
                      BUILD=(1,3451)),                                         
                      $                                                         
ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
                   IFTHEN=(WHEN=(3452,1,CH,EQ,C'2'),                           
                   $                                                           
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY           
                      BUILD=(1,3451))                                           
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2171
Location: @my desk

PostPosted: Wed Jun 05, 2013 2:37 pm    Post subject:
Reply with quote

Hi expat,

I don't have DFSORT here, but I was wondering how the non-matching records from File1 will be handled in the above job, Wont it come to the output just as it is in the REFORMAT along with the indicator at pos-3452?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 05, 2013 3:26 pm    Post subject:
Reply with quote

Hi Arun,

The output file contains the records that I want, in the format that I want, as I am only doing the OUTREC BUILD for the two conditions that I want to include.

I think icon_eyes.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2171
Location: @my desk

PostPosted: Wed Jun 05, 2013 3:31 pm    Post subject:
Reply with quote

Quote:
as I am only doing the OUTREC BUILD for the two conditions that I want to include.
Hi expat,

I am not sure how DFSORT works in this scenario, but I believe Syncsort will not filter records based on the IFTHENs, the unqualified records will pass to the output as it is in the REFORMAT. icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 05, 2013 3:43 pm    Post subject:
Reply with quote

Arun,

The DFSORT job is a replacement for another job, using two steps and SAS to produce the file. I have created both files from
a) The original job
b) The DFSORT job
and running a compare both files are exactly the same, so I have no worries over the validity of the output, but was just wondering if I could combine both the BUILD and OVERLAY together.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2171
Location: @my desk

PostPosted: Wed Jun 05, 2013 3:51 pm    Post subject:
Reply with quote

Quote:
I have no worries over the validity of the output, but was just wondering if I could combine both the BUILD and OVERLAY together.
Hi expat,

Of course this is off-topic icon_smile.gif

There may be no non-matching records from file1 for now, but the card made me thinking, what if they do come in input.

If we are sure if that scenario need not be considered, I would have preferred something equivalent to this
Code:
  JOIN UNPAIRED,F2                             
                                                   
  REFORMAT  FIELDS=(F2:1,3451,?)                   
                                                   
  INREC IFTHEN=(WHEN=(3452,1,CH,EQ,C'B'),         
            OVERLAY=(3448:C'A')),IFOUTLEN=3451


btw AFAIK, BUILD and OVERLAY cant go together. let's see what kolusu has to say on this.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 05, 2013 4:03 pm    Post subject:
Reply with quote

I did try a mini test with non matching records in file1 and you are right, they do come out.

Just changed the JOIN UNPAIRED,F1,F2 to JOIN UNPAIRED,F2 and it seems OK now.

icon_eyes.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jun 05, 2013 9:49 pm    Post subject: Reply to: Combining BUILD and OVERLAY in one statement, just
Reply with quote

expat,

You cannot use BUILD and OVERLAY at the same time. It has to be either BUILD or OVERLAY.

As Arunraj pointed out using IFOUTLEN is a good choice to discard the unnecessary fields.

Alternatively you can use CHANGE operator which can look up a value and change based on that value.

ex:
Code:

//SYSIN    DD *                                             
  OPTION COPY                                               
  JOINKEYS FILE=F1,FIELDS=(1,12,A)                           
  JOINKEYS FILE=F2,FIELDS=(1,12,A),SORTED,NOSEQCK           
  JOIN UNPAIRED,F2                                           
  REFORMAT  FIELDS=(F2:1,3451,?)                             

  INREC BUILD=(1,3447,                                       
               3452,1,CHANGE=(1,C'B',C'A'),NOMATCH=(3448,1),
               3449,3)                                       
/*                                                 
//JNF1CNTL DD *                                   
***  DELETE DUPS FROM JNF1 INPUT FILE
  SUM FIELDS=NONE                                 
/*             


The CHANGE operator will evaluate the value at 3452 and if it is a "B" then it will update the value at 3448 to an "A". If it is not "B" then it will copy the contents of 3448 AS IS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 06, 2013 11:38 am    Post subject:
Reply with quote

Thanks guys
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am
No new posts Inspect statement spoorni COBOL Programming 5 Mon Jun 06, 2016 9:53 pm


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