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 

Dynamically load a sort file using 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
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Apr 12, 2010 2:59 pm    Post subject: Dynamically load a sort file using REXX Reply with quote

I am able to sort a file by defining an input file (sortin), sort work files, sysout, and sysin containing my control cards. I then use the ADDRESS LINKMVS "SORT" to sort the file in the correct order and return it to my program.

My question is whether there is a way to take records and put them in the input file (SORTIN) dynamically (rather than build the dataset ahead of time) by feeding them into the SORTIN one at a time?

The sort should then return these records that had been fed into the SORTIN in the sort order specified by the SYSIN.

If this can be done, how is the SORTIN allocated? For example, my SYSIN file is defined as:

Code:
"ALLOC FILE(SYSIN) UNIT(SYSDA) NEW TRACKS SPACE(1,1) DELETE REUSE",
" LRECL(80) RECFM(F) BLKSIZE(80)"


NEW would not be valid for SORTIN. How do I define this?
Back to top
View user's profile Send private message
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Apr 12, 2010 4:26 pm    Post subject: Reply with quote

I found an answer. It turns out that if I define the field with a logical record length even though there is no actual permanent file, it would allow me to write to it.

I defined the file as:
Code:
ALLOC FILE(SORTIN) UNIT(SYSDA) LRECL(5000) NEW REUSE


and "queued" records and wrote them to SORTIN with a single write.

Code:
DO I = 1 to number_of_lines
                QUEUE LINEDATA     
          END

QUEUE ''
"EXECIO * DISKW SORTIN (FINIS"

Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Tue Apr 13, 2010 9:53 am    Post subject: Reply with quote

Sorry, mis-posted
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