View previous topic :: View next topic |
Author |
Message |
dtf Beginner
Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
|
Posted: Tue Apr 11, 2006 4:14 pm Post subject: Use ISPF services to sort a file from a REXX |
|
|
I have a very small file that is built from data entry via an ISPF panel. I would like to resulting file to be sorted.
I am wondering there would be an easy way to invoke an EDIT macro to issue the ISPF sort command, and then save the file.
________
New Jersey Marijuana Dispensaries
Last edited by dtf on Tue Mar 15, 2011 5:04 am; edited 1 time in total |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Apr 11, 2006 5:16 pm Post subject: |
|
|
dtf,
Check this link which might be of help
http://web.tampabay.rr.com/mvsrexx/REXX/tblsort.txt
In case you have trouble accessing the link then this is the code
Code: |
PROC 0
/* --------------------------------------------------------------------
/*
/* Sort an ISPF table. This task is done in a CLIST because REXX
/* incurs substantial overhead for ISPF table sorting due to it trying
/* to store each row-variable for each row it must handle. This is
/* architecturally a part of REXX's method and cannot be overcome,
/* therefore, table sorts should be handled by CLISTs.
/*
/* The table should be open before calling this routine.
/*
/* --------------------------------------------------------------------
ERROR DO
SET &LASTCC = &RC
RETURN
END
ISPEXEC VGET ($TN$ SORTSEQ DEBUG) SHARED
IF &DEBUG = DEBUG THEN CONTROL MSG SYMLIST CONLIST LIST
ELSE CONTROL NOMSG NOSYMLIST NOCONLIST NOLIST
ISPEXEC TBSORT &$TN$ FIELDS(&SORTSEQ)
IF &LASTCC NE 0 THEN DO
&ZERRSM = &STR(TBSORT ERROR)
&ZERRLM = &STR(TBSORT DELIVERED RC=&LASTCC FOR SORTSPEC +
&SORTSEQ)
&ZERRALRM = YES
&ZERRHM = ISR00000
ISPEXEC SETMSG MSG(ISRZ002)
END
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
dtf Beginner
Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
|
Posted: Wed Apr 12, 2006 9:58 am Post subject: |
|
|
Thanks for your response. What I a am wondering though is if it is possible to just invoke an EDIT macro or someting, and
Edit the dataset
enter the command "SORT"
exit the dataset
________
TF105
Last edited by dtf on Tue Feb 01, 2011 2:06 pm; edited 1 time in total |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
|
Back to top |
|
|
dtf Beginner
Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
|
Posted: Fri Apr 14, 2006 4:52 pm Post subject: |
|
|
thanks
________
teen vid |
|
Back to top |
|
|
|
|