MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use ISPF services to sort a file from a REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Tue Apr 11, 2006 4:14 pm    Post subject: Use ISPF services to sort a file from a REXX Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 11, 2006 5:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Wed Apr 12, 2006 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Apr 13, 2006 3:07 am    Post subject: Reply with quote

Dtf,

Create an ISREDIT Macro in REXX as shown below.

Code:

/*  REXX  */
 "ISREDIT MACRO"
  startcol = 5
  endcol  = 10
  order    = "A"
 "ISREDIT SORT " startcol endcol order
 "ISREDIT END"
exit 0


You just have to update the Startcol, EndCol, and Order fields appropriately.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZEM30/3.2.49?DT=20040721185339

Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Fri Apr 14, 2006 4:52 pm    Post subject: Reply with quote

thanks
________
teen vid
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group