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

Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)


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

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 12:24 pm
Reply with quote

I am calling ICEMAN from a REXX exec as:
Code:
ADDRESS TSO "CALL *(ICEMAN)"
but I subsequently, in the same exec, want to perform another sort from/to different files.
I want to be able to tell it to use "SRT1" as a substitute for "SORT" prefix in the first invocation, and "SRT2" in the second, hence...
Code:
...
//SRT1IN   DD DSN=INPUT.ONE
//SRT1OUT  DD DSN=OUTPUT.ONE
...
//SRT2IN   DD DSN=INPUT.TWO
//SRT2OUT  DD DSN=OUTPUT.TWO
...
If this could be dealt with as a standard utility I could override DDnames like this with ICEGENER (dots '.' are '00'Xs below)...
Code:
PARM = ''
DDLIST='........', /* SYSLIN   */
       '........', /* n/a      */
       '........', /* SYSLMOD  */
       '........', /* SYSLIB   */
       'TEMPIN  ', /* SYSIN    */
       'TEMPRINT', /* SYSPRINT */
       '........', /* SYSPUNCH */
       'TEMPUT1.', /* SYSUT1   */
       'TEMPUT2.', /* SYSUT2   */
       '........', /* SYSUT3   */
       '........', /* SYSUT4   */
       '........', /* SYSTERM  */
       '........', /* n/a      */
       '........'  /* SYSCIN   */
ADDRESS LINKMVS 'ICEGENER' 'PARM DDLIST'
but I cannot see a similar facility to do this with ICEMAN (odd?icon_eek.gif), and I have been RTFMing for some time!
Doubtless searching for the wrong thing! icon_rolleyes.gif
icon_confused.gif /Steve
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Oct 18, 2013 12:50 pm
Reply with quote

do not allocate the datasets from icl...

use something along the lines of

ALLOC all the files You need
call the program
FREE all the above

repeat for as many steps as you need

the approach is valid for any application
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:03 pm
Reply with quote

enrico-sorichetti wrote:
do not allocate the datasets from jcl...

Thanks Enrico,
Actually I was trying to avoid that approach, I can of course LISTDSI trap the DSname from the DDname and ALLOC REUSE it.
I may have to!? I was just hoping for a more user(coder)-friendly solution, perhaps an
Code:
  OPTIONS SORTIN=TEMPIN SORTOUT=TEMPOUT
...? icon_eek.gif
Continuing to RTFM for something!
Thanks /S
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 18, 2013 1:20 pm
Reply with quote

For DFSORT check the documentation of the OPTION control statement. They are there. Don't know how you missed them if using DFSORT.

Doesn't enrico's approach release resources as well as allowing re-use of the same program with different data?
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:29 pm
Reply with quote

Bill Woodger wrote:
Don't know how you missed them

Hi Bill.
Yes, I may revert to Enrico's suggestion.
I have SC26-7523-06 open as we speak, since 7am today! (as well as the Smart Tricks book) but could not find anything like this.
Am I going blind in my old age?! icon_cool.gif|
Do you have a topic reference that shows this, I tried almost every combination of
Code:
  OPTION SORTIN=TEMPIN,...
etc.etc. icon_cry.gif
/S
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 18, 2013 1:42 pm
Reply with quote

You can start with Figure 12. Bottom of the second block. I'm wondering if I'm answering the correct question...
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:57 pm
Reply with quote

I tried a test rig like so...
Code:
//SORT     EXEC PGM=ICEMAN       
//SYSOUT   DD SYSOUT=*           
//XXXXIN   DD *                 
ONE                             
TWO                             
THREE                           
SKIPIT                           
FOUR                             
SKIPTOO                         
FIVE                             
//XXXXOUT  DD SYSOUT=*           
//SYSIN    DD *                 
  RECORD TYPE=F,LENGTH=80       
  OPTION SORTIN=XXXXIN,         
           NOEQUALS             
  OUTFIL FNAMES=XXXXOUT         
  OMIT COND=(1,4,CH,EQ,C'SKIP') 
  SORT FIELDS=(1,8,CH,A)         
  SUM FIELDS=NONE               
/*
and I get nearer but... ABEND=S000 U0056 ...
Code:
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12
            RECORD TYPE=F,LENGTH=80                           
            OPTION SORTIN=XXXXIN,                             
                     NOEQUALS                                 
            OUTFIL FNAMES=XXXXOUT                             
            OMIT COND=(1,4,CH,EQ,C'SKIP')                     
            SORT FIELDS=(1,8,CH,A)                           
            SUM FIELDS=NONE                                   
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1       
ICE056A 0 SORTIN   NOT DEFINED                               
ICE751I 0 C5-K76982 C6-K90026 C7-K82419 C8-K91592 E7-K79990   
ICE052I 3 END OF DFSORT

Suck! (it's Swedish) icon_exclaim.gif /S
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:03 pm
Reply with quote

Bill Woodger wrote:
You can start with Figure 12. Bottom of the second block. I'm wondering if I'm answering the correct question...

Thanks Bill,
That's what I started with - I thought.!
Code:
  OPTION NOEQUALS,SORTIN=ddname,SORTOUT=ddname
I'll try again but!!! icon_exclaim.gif
icon_lol.gif /S
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:05 pm
Reply with quote

Code:
ICE000I J - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12
            RECORD TYPE=F,LENGTH=80                           
            OPTION SORTIN=XXXXIN,SORTOUT=XXXXOUT,NOEQUALS     
            OMIT COND=(1,4,CH,EQ,C'SKIP')                     
            SORT FIELDS=(1,8,CH,A)                           
            SUM FIELDS=NONE                                   
ICE201I J RECORD TYPE IS F - DATA STARTS IN POSITION 1       
ICE056A N SORTOUT  NOT DEFINED                               
ICE052I J END OF DFSORT   
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 18, 2013 2:06 pm
Reply with quote

Note for future readers. The context of SORTIN here is on the OPTION statement. The quote is not referring directly to what happens to the SORTIN DD. OPTION SORTIN= allows for a different DD name to be used for SORTIN, but when invoked from JCL OPTION SORTIN (and others noted) are not availale on the OPTION statement.

Quote:
1. SORTIN is processed only if it is passed on the OPTION control statement
in an extended parameter list
, or in DFSPARM.


So try DFSPARM.

You might want to look at SORTDD once you get it working.

These options are designed for invocation from from programs, rather than from JCL per se, but there are uses from JCL. There are differences to how and what OPTIONs are allowed in different circumstances. Getting it working from JCL doesn't necessarily give you what will work from a program.


Quote:
Note for Syntax Diagram: The keywords EFS, LIST, NOLIST, LISTX, NOLISTX,
MSGDDN, MSGPRT, SMF, SORTDD, SORTIN, SORTOUT, and USEWKDD are
used only when they are specified on the OPTION control statement passed by an
extended parameter list or when specified in the DFSPARM data set. If they are
specified on an OPTION statement read from the SYSIN or SORTCNTL data set,
the keyword is recognized, but the parameters are ignored.

For DFSPARM start at "Main features of sources of DFSORT options".
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:12 pm
Reply with quote

YESSSSSSSSSSSSSSSSS!!!
THANKS!!! /S icon_biggrin.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 18, 2013 2:17 pm
Reply with quote

Quote:
Note for Syntax Diagram: The keywords EFS, LIST, NOLIST, LISTX, NOLISTX,
MSGDDN, MSGPRT, SMF, SORTDD, SORTIN, SORTOUT, and USEWKDD are
used only when they are specified on the OPTION control statement passed by an
extended parameter list or when specified in the DFSPARM data set. If they are
specified on an OPTION statement read from the SYSIN or SORTCNTL data set,
the keyword is recognized, but the parameters are ignored.


For DFSPARM start at "Main features of sources of DFSORT options".

EDIT: Missed your last Steve. Still, could be useful for someone else.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:18 pm
Reply with quote

Code:
//SORT     EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//XXXXIN   DD *                                 
ONE                                             
TWO                                             
THREE                                           
SKIPIT                                         
FOUR                                           
SKIPTOO                                         
FIVE                                           
//XXXXOUT  DD SYSOUT=*                         
//SYSIN    DD *                                 
//DFSPARM  DD *                                 
  RECORD TYPE=F,LENGTH=80                       
  OPTION SORTIN=XXXXIN,SORTOUT=XXXXOUT,NOEQUALS
  OMIT COND=(1,4,CH,EQ,C'SKIP')                 
  SORT FIELDS=(1,8,CH,A)                       
  SUM FIELDS=NONE                               
/*
Thanks again! /S icon_biggrin.gif
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top