IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Records need to be put back to Original


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Mon Feb 20, 2012 9:49 am
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: 1702
Location: Australia

PostPosted: Mon Feb 20, 2012 10:06 am
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: 51
Location: India

PostPosted: Mon Feb 20, 2012 10:24 am
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: 1702
Location: Australia

PostPosted: Mon Feb 20, 2012 10:36 am
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: 2455
Location: Hampshire, UK

PostPosted: Mon Feb 20, 2012 10:40 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 20, 2012 12:44 pm
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: 1788
Location: Bloomington, IL

PostPosted: Mon Feb 20, 2012 4:05 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Mon Feb 20, 2012 4:13 pm
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

Superior Member


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

PostPosted: Mon Feb 20, 2012 5:22 pm
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: 51
Location: India

PostPosted: Mon Feb 20, 2012 9:38 pm
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: 8797
Location: Welsh Wales

PostPosted: Mon Feb 20, 2012 10:17 pm
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

Superior Member


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

PostPosted: Tue Feb 21, 2012 7:00 pm
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: 771
Location: Germany

PostPosted: Tue Feb 21, 2012 7:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts how to keep unpaired records with REPRO. JCL & VSAM 9
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
No new posts Removal of date value records DFSORT/ICETOOL 12
No new posts Concurrent writing records to VSAM fr... JCL & VSAM 9
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top