View previous topic :: View next topic
|
Author |
Message |
raj4neo Warnings : 1 New User
Joined: 12 May 2006 Posts: 51 Location: India
|
|
|
|
I have a a Infile of 1000 records and i have to sort the file with
sort fields = 1,100,CH, A
AFTER my another step
i need to put the back the records in previous order
is there a way |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what does this actually do
Quote: |
AFTER my another step
|
Can you add a sequence number using SORT at the end of the file ?
Will my
Quote: |
AFTER my another step
|
handle the additional bytes ?
Was the original file sorted ?
Gerry |
|
Back to top |
|
|
raj4neo Warnings : 1 New User
Joined: 12 May 2006 Posts: 51 Location: India
|
|
|
|
Here is my requiterement
Step 1 which wil sort the infile
based on condition
sort fields = 1,100,CH,A
//S1 EXEC PGM=SYNCSORT,COND=(0,LT)
//SORTIN DD DSN=BPV380.G1,DISP=SHR
//SORTOUT DD DSN=BPV380.G1
// DISP=(OLD,CATLG,DELETE),
//SYSIN DD *
SORT FIELDS=(1,100,CH,A)
Step 2 is a Ezetrive program which will delete few records from File
BPV380.G1 based on certain conditions
Step 3 : I need to Put back the File BPV380.G1 which is in sorted order to previous original order |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
assuming your input file is 80 bytes, just add this to your SORT
Code: |
INREC OVERLAY=(81:SEQNUM,8)
|
Now your file has an extra 8 bytes which you need to pass to your program, the output from your program can now be sorted on the additional 8 bytes.
Your program must retain the sequence number.
Gerry |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You should NOT use the same file for SORTOUT as you do for SORTIN. This is one reason why. Another would be if the sort failed and then you had a file that was half way between your input and your desired result. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
raj4neo wrote: |
//SORTOUT DD DSN=BPV380.G1
// DISP=(OLD,CATLG,DELETE),
|
And hat does thiis do?
Code tags to preserve sapcing for stuff from your mainframe screen, please. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Bill Woodger wrote: |
raj4neo wrote: |
//SORTOUT DD DSN=BPV380.G1
// DISP=(OLD,CATLG,DELETE),
|
And hat does thiis do? |
Generates a JCL error. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
need to put the back the records in previous order |
define ... previous order
and... post the info You were asked to provide
was the file <sorted> somehow ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
The way you've posted teh question and what I understand - small answer for your question is - no, that's not possible.
I also agree with what Nic says, why do you use the same name for SORTIn and SORTOUT?
Quote: |
I need to Put back the File BPV380.G1 which is in sorted order to previous original order |
Do you just want to put the order back or is it input to some other process? If it is not, why are you bothered about the order in which records are stacked.
For a solution, can't you execute Easytrive first before sort, if there are only 1000 records strictly? |
|
Back to top |
|
|
raj4neo Warnings : 1 New User
Joined: 12 May 2006 Posts: 51 Location: India
|
|
|
|
yeah its working ,
the file was used in the many other jobs , if we sort the file , it will change to certain other order , the next step is cobol-db2 program step , it will read the tables based on the Infile , the sort order doesn't match with index partition of the table and cause extreme delays.......... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This is wierd. You want to sort a file twice when once will suffice.
Why not just sort the file to a different output dataset, use that dataset in the following job/step, and just leave the original file intact ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
raj4neo wrote: |
yeah its working |
Grumble - what is changed? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ expat
That would not be difficult enougth.
Would be too easy. |
|
Back to top |
|
|
|