View previous topic :: View next topic |
Author |
Message |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Apr 12, 2010 2:59 pm Post subject: Dynamically load a sort file using REXX |
|
|
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 |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Apr 12, 2010 4:26 pm Post subject: |
|
|
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 |
|
|
taltyman JCL Forum Moderator
Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Tue Apr 13, 2010 9:53 am Post subject: |
|
|
Sorry, mis-posted |
|
Back to top |
|
|
|
|