Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invoking DFSORT from rexx

Status
Not open for further replies.

mayankb

Programmer
Nov 11, 2002
5
GB
PPl

I tried real hard but cudnt invoke DFSORT from Rexx.
Is it possible , if so how its done, or just give me a pointer.

Regards
Mayank
 
It sure is. This code is for SYNCSORT, but it should work for DFSORT too.

s=userid()
"ALLOC F(SORTIN) DA('"s".SNAPIN') SHR REUSE"
"ALLOC F(SORTOUT) DA('"s".SNAPIN.OUTPUT') SHR REUSE"
"ALLOC F(SYSOUT) DA('*') SHR REUSE"
"ALLOC FILE(SYSIN) SPACE(1,1) TRACK LRECL(80) RECFM(F) BLKSIZE(80) REU"
SYSIN.1 = " SORT FIELDS=5,4,CH,A)"
'EXECIO * DISKW SYSIN (STEM SYSIN. FINIS'
"Call 'SPD3.SYNCSORT.LINKLIB(SORT)'"

I guess it also really depends on what you are sorting too. TBSORT can be used for sorting tables and will definately work with DFSORT.

Hope this helps.

 
Kevin
I tried ADDRESS LINK SORT, and kept the control statement in a parameter file. The SORT abends with ICE007A and ICE010A. The same parameter file works fine for another SORT (executed thru jcl). My SYSIN control file contains:
OPTION COPY
OUTFIL NODETAIL,TRAILER1=(COUNT=(EDIT=(TTTTT)))

Many thanks
Mayank
 
What do you mean by parameter file? What is the exact format of your call to SORT? It looks to me like SORT isn't picking up your SYSIN for whatever reason. Could you post a the pertinent REXX code here?

 
Kevin
the code is:
"ALLOC DA('LSMXB54.BPPJ815D.OUTFILE') FI(SORTIN) SHR"
"ALLOC DA('LSMXB54.BPPJ815D.OUTFILE1') FI(SORTOUT) SHR"
"ALLOC DA('LSMXB54.HEADR.PARMS(SORTP)') FI(SYSIN) SHR"
ADDRESS LINK SORT

SORTP file contains the above mentioned lines.
 
Hmmmmmm...I suspect that the ALLOC for SYSIN may be failing.

Usually SYSIN is assigned to the terminal DA(*). Try using REUSE on the ALLOC.

Then I would say that using :

Address TSO
"Call Sort"

May just do the trick. :)
 
Hmmm...:) none worked...

The sort is still giving this weird error message

ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 18:42 ON TUE NOV
n " 0 " 0 " 0 " 0 " 0 " 0 " 0 " 0
ICE007A 1 SYNTAX ERROR
n " 0 " 0 " 0 " 0 " 0 " 0 " 0 " 0
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE052I 3 END OF DFSORT
 
Hmmmmmmmm It is begining to look like SORT is trying to read it's SYSIN from a source other than SYSIN....and failing miserably.

Quick question here....are you doing this as a batch job or in the foreground?
 
One more question.......do you have any EXECs in SYSEXEC or SYSPROC that are named SORT by any chance?

 
Kevin
I m doing this as a batch job and none of my SYSEXEC or SYSPROC is a SORT.
 
Have you specified DYNAMNBR on the EXEC card?

I have DYNAMNBR=20 specified and it seems to work fine.

My JCL is:

//STEP1 EXEC PGM=IKJEFT01,PARM='SORTTEST',DYNAMNBR=20
//SYSEXEC DD DISP=SHR,DSN=CD9P07.REXX.MSTR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY

Good luck
 
Time out..... He says he's running this as a batch job but he has ALLOCates in the TSO foreground. Not 'batch'; not JCL.

The OP needs to run this process with TRACE ?R to make sure that every statement operates correctly.

If all statements are operating correctly, SORT should be called as:
Code:
CALL *(SORT)
. The "*" will find the module wherever it lives.
 
Rexxhead

I am not sure I follow you here. There should be no problem using ALLOC's when using REXX in batch job. I also do not understand why tracing would make any difference to the ALLOC process or do you simply mean so that he can trap any unsuccessful allocates and report them accordingly?
 
I have had lots of 'fun' doing this! Try the code below, it works for me, I took out some of the error handly to get an easy cut/paste. Also, it can be sensitive to the RACF/ACF2 authority of who is invoking the REXX and whether the SORT program in on the APF listing. Try looking in your syslog at the time the script fails for odd messages.

"ALLOC SYSPRINT SYSOUT CLASS(X)"
if RC ¬= 0 then do
signal Exit_Here
End

"ALLOC F(sysin) DA('"parmlib"') reuse"
if RC ¬= 0 then do
signal Exit_Here
End

"ALLOC F(sortin) DA('"dsn2"') reuse"
if RC ¬= 0 then do
signal Exit_Here
End

"ALLOC F(sortout) DA('"dsn2"') reuse"
if RC ¬= 0 then do
signal Exit_Here
End


"CALL 'SYS1.SICELINK(SORT)'"

"FREE F(sysin,sortin,sortout,sysprint)"

SORT is a psudonim for DFOSRT where I work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top