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
 

 

Need SORT Jcl for the following problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sen_1983us

New User


Joined: 21 May 2005
Posts: 18
Location: Hyderabad

PostPosted: Sun Oct 23, 2005 2:48 am    Post subject: Need SORT Jcl for the following problem
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 Moderator


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

PostPosted: Sun Oct 23, 2005 9:29 pm    Post subject:
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: 18
Location: Hyderabad

PostPosted: Sun Oct 23, 2005 11:48 pm    Post subject: Please clarify...frank
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 Moderator


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

PostPosted: Mon Oct 24, 2005 12:02 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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