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

Sort skiprec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
imagines

New User


Joined: 10 Sep 2007
Posts: 18
Location: Italy

PostPosted: Thu Feb 28, 2019 1:30 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 28, 2019 1:49 am
Reply with quote

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
View user's profile Send private message
imagines

New User


Joined: 10 Sep 2007
Posts: 18
Location: Italy

PostPosted: Thu Feb 28, 2019 1:58 am
Reply with quote

thank you Arun i'll try with EXPORT SYMLIST
Back to top
View user's profile Send private message
imagines

New User


Joined: 10 Sep 2007
Posts: 18
Location: Italy

PostPosted: Thu Feb 28, 2019 2:56 pm
Reply with quote

ok works . ;)
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Tue Mar 05, 2019 9:35 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


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

PostPosted: Wed Mar 06, 2019 3:06 pm
Reply with quote

Thats right. I would have passed the parms with JPx TBH. Guess that's the better option here.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 06, 2019 8:25 pm
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 934
Location: Maryland

PostPosted: Fri Mar 08, 2019 9:17 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 7
No new posts Date conversion using SORT SYNCSORT 4
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
Search our Forums:

Back to Top