Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Records need to be put back to Original

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Mon Feb 20, 2012 9:49 am    Post subject: Records need to be put back to Original
Reply with quote

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

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Feb 20, 2012 10:06 am    Post subject:
Reply with quote

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
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Mon Feb 20, 2012 10:24 am    Post subject:
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Feb 20, 2012 10:36 am    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Feb 20, 2012 10:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Mon Feb 20, 2012 12:44 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Mon Feb 20, 2012 4:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Feb 20, 2012 4:13 pm    Post subject: Reply to: Records need to be put back to Original
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Feb 20, 2012 5:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 49
Location: India

PostPosted: Mon Feb 20, 2012 9:38 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 20, 2012 10:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Feb 21, 2012 7:00 pm    Post subject:
Reply with quote

raj4neo wrote:
yeah its working
Grumble - what is changed?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Tue Feb 21, 2012 7:36 pm    Post subject:
Reply with quote

@ expat

That would not be difficult enougth.
Would be too easy.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us