|
View previous topic :: View next topic
|
| Author |
Message |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
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.
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
| 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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
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.
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.
IFTHEN INIT should apply in any case, doesn't it? |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Joerg.Findeisen wrote: |
Btw, the competitor does the same attempt without issues.  |
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
| 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.
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
Sorry for the delayed response. It's a weekend before a bank holiday here and I am On-call.
@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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
| 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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|