View previous topic :: View next topic
|
Author |
Message |
imagines
New User
Joined: 10 Sep 2007 Posts: 18 Location: Italy
|
|
|
|
Hi
is posssible to pass a numeric set variable into Sort skiprec ?
Code: |
set x=100
set y=150
/SETP001 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//REPORT1 DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=USERID.ABC.INPFILE,
//SORTOUT DD DSN=USERID.ABC.OUTFILE,
// DISP=(,CATLG),
// SPACE=(TRK,(30,10),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)
//SORTWK01 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK02 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SORTWK03 DD UNIT=DISK,SPACE=(CYL,(20,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY,SKIPREC=x,STOPAFT=y
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
If your site supports the EXPORT command, you could do something like this, or use the JPn parm to pass symbolics to the DFSORT control statements.
Code: |
// EXPORT SYMLIST=(X,Y)
// SET X=100,Y=150
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
....
....
//SYSIN DD *,SYMBOLS=JCLONLY
SORT FIELDS=COPY,SKIPREC=&X,STOPAFT=&Y |
|
|
Back to top |
|
|
imagines
New User
Joined: 10 Sep 2007 Posts: 18 Location: Italy
|
|
|
|
thank you Arun i'll try with EXPORT SYMLIST |
|
Back to top |
|
|
imagines
New User
Joined: 10 Sep 2007 Posts: 18 Location: Italy
|
|
|
|
ok works . ;) |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Although a working solution has been provided, the following can be useful:
Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
....
....
//SYMNAMES DD *
SKP,100 /* careful, "SKIP" has a special meaning */
STP,150
//SYSIN DD *
SORT FIELDS=COPY,SKIPREC=SKP,STOPAFT=STP |
mostly because the values can be dynamically created in a previous step, if it has any meaning.
(NB: tested with SYNCSORT because that's what I have, but checked with the DFSORT documentation. Should work...) |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1255 Location: Bamberg, Germany
|
|
|
|
Thats right. I would have passed the parms with JPx TBH. Guess that's the better option here. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
mostly because the values can be dynamically created in a previous step, if it has any meaning. |
Agree. I thought the OP wanted to run different jobs with the same steps but with a different value for the SKIPREC and STOPAFT-controlled by the SET symbolic, but like you said the symbols could be named in such a way that'd make sense. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
You may be surprised, but it also works in a simple manner:
Code: |
// SET X=100,Y=150
//STEP01 EXEC PGM=SORT,PARM='SKIPREC=&X,STOPAFT=&Y'
//SYSOUT DD SYSOUT=*
// ....
// ....
//SYSIN DD *
SORT FIELDS=COPY
END
//*
|
|
|
Back to top |
|
|
|