Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Steve Coalbran

New User


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

PostPosted: Fri Oct 18, 2013 12:24 pm    Post subject: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Oct 18, 2013 12:50 pm    Post subject: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:03 pm    Post subject: Re: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 18, 2013 1:20 pm    Post subject: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:29 pm    Post subject: Re: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 18, 2013 1:42 pm    Post subject: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 1:57 pm    Post subject: Re: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:03 pm    Post subject: Re: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:05 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 18, 2013 2:06 pm    Post subject: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:12 pm    Post subject: Re: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Oct 18, 2013 2:17 pm    Post subject: Reply to: Alternate DDNAMEs for SORTIN, SORTOUT (in REXX)
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: 85
Location: Stockholm, Sweden

PostPosted: Fri Oct 18, 2013 2:18 pm    Post subject:
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    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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us