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

OUTREC OVERLAY different to INCREC generated INPUT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Fri Apr 27, 2018 2:11 am
Reply with quote

Hello,

I have the following input from IDCAMS in a VBA;125 dataset:

Code:

0GDG BASE ------ SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403             
        DATASET-OWNER---V-USR403     CREATION--------2011.106   
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00   
        DATASET-OWNER-----(NULL)     CREATION--------2018.090   
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00   
        DATASET-OWNER-----(NULL)     CREATION--------2018.098   
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00   
        DATASET-OWNER-----(NULL)     CREATION--------2018.104   


expected output is basically a descending list by name, listing creation date and datediff to today plus the GDG base here.

Code:

ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00 W20181042018116+0000012SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00 W20180982018116+0000018SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00 W20180902018116+0000026SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403
?SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403          W20111062018116+0002567SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403


Problem is, as soon as I apply additional IFTHEN in the OUTREC the result is different on what INREC has provided. To test, just move the END before OUTREC to see what's meant. Any advise on where to look for the bug is appreciated. Btw, the competitor does the same attempt without issues. icon_eek.gif

Code:

//PARSE    EXEC PGM=SORT,PARM='MSG=AP'                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=&SYSUID..SYSPRINT                           
//SORTOUT  DD SYSOUT=*,LRECL=170                                       
//SYSIN    DD *                                                         
  OPTION VLSCMP                                                         
  SORT FIELDS=(6,44,CH,D)                                               
  INCLUDE COND=((6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),OR,     
                 42,16,CH,EQ,C'CREATION--------')                       
  INREC IFTHEN=(WHEN=GROUP,                                             
    BEGIN=(6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),             
    PUSH=(126:22,44)),                                                 
    IFTHEN=(WHEN=(42,16,CH,EQ,C'CREATION--------'),                     
      BUILD=(1,4,C'?',126,44,X,58,8,UFF,M11,LENGTH=7,DATE3),HIT=NEXT), 
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      PARSE=(%00=(STARTAFT=C'.PDUMP.',ENDBEFR=C'.',FIXLEN=1)),         
      OVERLAY=(50:%00,65:6,44,JFY=(SHIFT=RIGHT),                       
               65:65,35,JFY=(SHIFT=LEFT)),HIT=NEXT),                   
    IFTHEN=(WHEN=(101,1,CH,EQ,C'G',AND,                                 
                 (102,4,ZD,GE,+0,AND,102,4,ZD,LE,+9999),AND,           
                  106,1,CH,EQ,C'V',AND,107,2,ZD,EQ,+0),                 
      BUILD=(1,4,C'Z',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,65,35,9X)),                     
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      BUILD=(1,4,C'?',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,6,44))                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(121:+0,TO=ZD,LENGTH=4))             
  END                                                                   


Cheers,
Joerg

Edit: Updated expected output.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Fri Apr 27, 2018 4:08 am
Reply with quote

Joerg.Findeisen wrote:
Code:
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(121:+0,TO=ZD,LENGTH=4))


1. The single IFTHEN=(WHEN=INIT...) doesn't make a real sense. It works in the same manner as unconditional OUTREC OVERLAY=...

2. It would be nice to have samples: what output is expected vs. what is produced with/without this "extra IFTHEN"? The readers have no obligation to run such test for you.

3. For clarity, and for better understanding of the process it would be a good idea to place the control statements in the order they are really applied at run time:
Code:
 INCLUDE ...
 INREC ...
 SORT ...
 OUTREC ...
 OUTFIL ...
 END
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Fri Apr 27, 2018 12:18 pm
Reply with quote

Thanks for replying back and the hints for coding. I am so used to that sequence that I had forgotten to rearrange it prior to posting. icon_redface.gif

The OUTREC was coded with the first IFTHEN only (there are more to follow) but basically it should make no difference. Althou it does presently..

So the difference is shown here with OUTREC OVERLAY (suggested by you):

Code:

ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00 W20181042018116+0000012SA$S..
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00 W20180982018116+0000018SA$S..
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00 W20180902018116+0000026SA$S..
?SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403          W20111062018116+0002567SA$S..
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00           
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00           
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00           
0GDG BASE ------ SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403                     


and here with OUTREC IFTHEN OVERLAY applied:

Code:

ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00 W20181042018116+0000012SA$S..
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00 W20180982018116+0000018SA$S..
ZSA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00 W20180902018116+0000026SA$S..
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0125V00           
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0126V00           
0NONVSAM ------- SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403.G0127V00           
0GDG BASE ------ SA$SICH.LPAR.DFDSS.PDUMP.W.VUSR403                     
?                                             20111062018116+0002567   


I would expect the first output as this is where I want to apply additional IFTHEN clauses for the final job. Just don't see my mistake here. icon_rolleyes.gif
IFTHEN INIT should apply in any case, doesn't it?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Apr 27, 2018 6:22 pm
Reply with quote

Joerg.Findeisen wrote:
Btw, the competitor does the same attempt without issues. icon_eek.gif
Were you suggesting that, with some other sort product, it gives a different result? I am trying to figure out what exactly is your problem.
Can you post the control statements that you used for each run that produced the different results above?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Fri Apr 27, 2018 11:56 pm
Reply with quote

Joerg.Findeisen wrote:
Thanks for replying back and the hints for coding. I am so used to that sequence that I had forgotten to rearrange it prior to posting. icon_redface.gif


I cannot run this test by myself right now, but you continuously refuse to provide THE REQUIRED INFO IN FULL.

Sorry, in this case I cannot help.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Sun Apr 29, 2018 4:49 pm
Reply with quote

Sorry for the delayed response. It's a weekend before a bank holiday here and I am On-call. icon_confused.gif

@Arun: Yes, your assumption is correct. SYNCSORT does give me a different result compared to DFSORT when I use in the OUTREC the following statement:

Code:
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(121:+0,TO=ZD,LENGTH=4))

To me it should provide exactly the same result as when using:
Code:
OUTREC OVERLAY=(121:+0,TO=ZD,LENGTH=4)


To summarize this, DFSORT provides same result for both variants in the OUTREC statement while SYNCSORT fails using IFTHEN OVERLAY in my OUTREC.

@sergeyken: Hope I could make the issue more clear now. Sorry for the confusion if any.

Initial question of mine was if I am doing something wrong for SYNCSORT or if it is a bug in the Software. Presently I am guessing my coding is correct.

Cheers,
Joerg
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Sun Apr 29, 2018 9:24 pm
Reply with quote

Code:
//PARSE    EXEC PGM=SORT,PARM='MSG=AP'                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=&SYSUID..SYSPRINT                           
//SORTOUT  DD SYSOUT=*,LRECL=170                                       
//SYSIN    DD *                                                         
  OPTION VLSCMP                                                         
  SORT FIELDS=(6,44,CH,D)                                               
  INCLUDE COND=((6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),OR,     
                 42,16,CH,EQ,C'CREATION--------')                       
  INREC IFTHEN=(WHEN=GROUP,                                             
    BEGIN=(6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),             
    PUSH=(126:22,44)),                                                 
    IFTHEN=(WHEN=(42,16,CH,EQ,C'CREATION--------'),                     
      BUILD=(1,4,C'?',126,44,X,58,8,UFF,M11,LENGTH=7,DATE3),HIT=NEXT),
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      PARSE=(%00=(STARTAFT=C'.PDUMP.',ENDBEFR=C'.',FIXLEN=1)),         
      OVERLAY=(50:%00,65:6,44,JFY=(SHIFT=RIGHT),                       
               65:65,35,JFY=(SHIFT=LEFT)),HIT=NEXT),                   
    IFTHEN=(WHEN=(101,1,CH,EQ,C'G',AND,                                 
                 (102,4,ZD,GE,+0,AND,102,4,ZD,LE,+9999),AND,           
                  106,1,CH,EQ,C'V',AND,107,2,ZD,EQ,+0),                 
      BUILD=(1,4,C'Z',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,65,35,9X)),                     
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      BUILD=(1,4,C'?',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,6,44))                         
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(121:+0,TO=ZD,LENGTH=4))             
  END


is different in DFSORT and SYNCSORT,while

Code:
//PARSE    EXEC PGM=SORT,PARM='MSG=AP'                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=&SYSUID..SYSPRINT                           
//SORTOUT  DD SYSOUT=*,LRECL=170                                       
//SYSIN    DD *                                                         
  OPTION VLSCMP                                                         
  SORT FIELDS=(6,44,CH,D)                                               
  INCLUDE COND=((6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),OR,     
                 42,16,CH,EQ,C'CREATION--------')                       
  INREC IFTHEN=(WHEN=GROUP,                                             
    BEGIN=(6,15,SS,EQ,C'GDG BASE ------,NONVSAM -------'),             
    PUSH=(126:22,44)),                                                 
    IFTHEN=(WHEN=(42,16,CH,EQ,C'CREATION--------'),                     
      BUILD=(1,4,C'?',126,44,X,58,8,UFF,M11,LENGTH=7,DATE3),HIT=NEXT),
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      PARSE=(%00=(STARTAFT=C'.PDUMP.',ENDBEFR=C'.',FIXLEN=1)),         
      OVERLAY=(50:%00,65:6,44,JFY=(SHIFT=RIGHT),                       
               65:65,35,JFY=(SHIFT=LEFT)),HIT=NEXT),                   
    IFTHEN=(WHEN=(101,1,CH,EQ,C'G',AND,                                 
                 (102,4,ZD,GE,+0,AND,102,4,ZD,LE,+9999),AND,           
                  106,1,CH,EQ,C'V',AND,107,2,ZD,EQ,+0),                 
      BUILD=(1,4,C'Z',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,65,35,9X)),                     
    IFTHEN=(WHEN=(5,1,CH,EQ,C'?'),                                     
      BUILD=(1,4,C'?',6,44,50,1,51,7,58,7,                             
             58,7,Y4T,DATEDIFF,51,7,Y4T,6,44))                         
  OUTREC OVERLAY=(121:+0,TO=ZD,LENGTH=4)             
  END


produces the same output in both products. As stated, there are a few more IFTHEN in my OUTREC (which I haven't posted yet) to be applied so I wish to see the same result with IFTHEN at first. Sometimes SYNCSORT is more strict with Syntax and it puzzles me why I see different results.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Sun Apr 29, 2018 9:40 pm
Reply with quote

The code shall be used to find expired DFDSS backups which by identifier can be either Daily, Weekly or Monthly and have a creation date that exceeds a certain value (hence the IDCAMS input).
If all GDS have been expired also the associated empty GDG base with no active GDS has to be deleted.

With the supplied code, SYNCSORT would provide me with DELETE statements for the latest active GDS which is not correct.

Most of my installations do have in fact DFSORT which never lets me down, but out of curiosity I'd like to see it working also with SYNCSORT.

Cheers,
Joerg
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Mon Apr 30, 2018 5:58 am
Reply with quote

If it might be of interest, the SYNCSORT level used identifies itself with:

WER169I RELEASE 2.1 BATCH 0539 TPF LEVEL 1.1
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts force tablespace using LISTDEF input DB2 1
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
Search our Forums:

Back to Top