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: 51
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: 51
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: 1800
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: 7315

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: 1763
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: 10272
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: 51
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: 755
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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