Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort skiprec

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort skiprec
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1315
Location: Israel

PostPosted: Tue Mar 05, 2019 9:35 pm    Post subject: Reply to: Sort skiprec
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

New User


Joined: 15 Aug 2015
Posts: 24
Location: Germany

PostPosted: Wed Mar 06, 2019 3:06 pm    Post subject:
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    Post subject:
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 User


Joined: 29 Apr 2008
Posts: 450
Location: Maryland

PostPosted: Fri Mar 08, 2019 9:17 pm    Post subject:
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    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 To remove the spaces using SORT Card dharmaraok DFSORT/ICETOOL 1 Tue Apr 30, 2019 3:42 pm
No new posts How to convert hex to Displayable for... Log Thangavel DFSORT/ICETOOL 11 Fri Feb 22, 2019 9:33 am
No new posts Build SQL query using SORT balaji81_k DFSORT/ICETOOL 15 Mon Feb 18, 2019 9:56 am
No new posts Build Dynamic Sort output and limit '... balaji81_k DFSORT/ICETOOL 3 Sat Feb 02, 2019 4:40 am
This topic is locked: you cannot edit posts or make replies. PARAMETER 'F1' IS UNIDENTIFIED error ... Poha Eater DFSORT/ICETOOL 14 Fri Feb 01, 2019 2:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us