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

Need SORT Jcl for the following problem


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sen_1983us

New User


Joined: 21 May 2005
Posts: 21
Location: Hyderabad

PostPosted: Sun Oct 23, 2005 2:48 am
Reply with quote

Is there any SYSIN command to sort-compare the following scenario

GDG(-1) - record length - 7 bytes
A1OCT18
A2OCT18
A3OCT17
A4OCT17

GDG(0) - record length - 7 bytes
A1OCT19
A2OCT18
A3OCT19
A4OCT17
A5OCT19

I should get the following output :
A1OCT19
A3OCT19
A5OCT19

GDG(0) and GDG(-1) should get compared:

1. if both has the same record , it shouldn't come in the output ,ex: A2OCT18 & A4OCT17 (A duplicate record would mean all the fields within the records have a one to one match. )

2. if new record[it shldn't be in GDG(-1)] was found in GDG(0) , it shld come in output , ex:A5OCT19

3. when comparing , if any of the record got changed from the previous version , it shld come in output, ex:A1OCT19 & A3OCT19.

I want this to be done in JCL , not in the program.
If any one of u know how to do this , pls send me the command.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Oct 23, 2005 9:29 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=...  GDG(-1)
//    DD DSN=...  GDG(0)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(CON) TO(T1) ON(1,7,CH) NODUPS
SELECT FROM(T1) TO(OUT) ON(1,2,CH) LAST
/*
Back to top
View user's profile Send private message
sen_1983us

New User


Joined: 21 May 2005
Posts: 21
Location: Hyderabad

PostPosted: Sun Oct 23, 2005 11:48 pm
Reply with quote

HI Frank,

i'm describing my understanding if any wrong please correct me...

CON DD DSN=... GDG(-1)
DD DSN=... GDG(0)

in the above statements ur defining the GDG's

T1 DD DSN=&&T1 this is temporary file used to compare and check dups..

TOOLIN DD *
SELECT FROM(CON) TO(T1) ON(1,7,CH) NODUPS
SELECT FROM(T1) TO(OUT) ON(1,2,CH) LAST


here u r comparing in first step and making output in second step..

Regards
senthil
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Oct 24, 2005 12:02 am
Reply with quote

Yes, CON concatenates the -1 input GDG and the 0 input GDG in that order.

Yes, T1 is a temporary file.

The first SELECT only keeps the nondup records between the two files based on the key in positions 1-7. The result is placed in T1.

The second SELECT uses the remaining records as input (T1) and selects the last record with each key in position 1-2 for output (OUT).

For complete details on DFSORT's ICETOOL, see Chapter 6 of "z/OS DFSORT Application Programming Guide". You can access all of the DFSORT books online, including that one, from:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top