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

Need single sort card to sort and pick the topmost rec


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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Dec 07, 2010 1:04 pm
Reply with quote

Sure Arun...!!

1. Listcat for two ip files with only the latest generation details.

Code:
//*********************************************************************
//*                                                                   *
//* GET THE LATEST GDG FILE NAMES FOR THE OUTPUT DATA FILES           *
//*                                                                   *
//*********************************************************************
//*                                                                     
//LISTCAT EXEC PGM=IDCAMS,COND=(0,NE)                                   
//DD1       DD DISP=SHR,DSN=TTA.TAI23.VRS.POLMSTR(+1)                   
//DD2       DD DISP=SHR,DSN=TTA.TAI23.VRS.CESSDATA(+1)                 
//SYSTSPRT  DD SYSOUT=*                                                 
//SYSPRINT  DD DISP=(NEW,PASS),DSN=&&LISTGDG,                           
//             SPACE=(TRK,(35,45),RLSE),UNIT=SYSWK                     
//SYSOUT    DD SYSOUT=*                                                 
//AMSDUMP   DD SYSOUT=*                                                 
//SYSIN     DD DISP=SHR,DSN=TTA.RAIPUMO.VRS.CTLCARD(TAIVLST1)           
//*                                                                     



2. The sortcard

Code:

***************************** Top of Data **
 PRINT INFILE(DD1) COUNT(0) CHAR             
 PRINT INFILE(DD2) COUNT(0) CHAR             
**************************** Bottom of Data


3. Vertical Merge

Code:
000184 //*********************************************************************
000185 //*                                                                   *
000186 //* MERGE THE LATEST GDG FILE NAMES WITH THE CONTROL FILE             *
000187 //*                                                                   *
000188 //*********************************************************************
000189 //*                                                                     
000190 //SORT07  EXEC PGM=SORT,COND=(0,NE),                                   
000191 //             PARM='CORE=MAX'                                         
000192 //SYSOUT    DD SYSOUT=*                                                 
000193 //SORTLIB   DD DISP=SHR,DSN=SYS1.SUBLIB                                 
000194 //SORTJNF1  DD DISP=(OLD,DELETE),DSN=&&LISTGDG                         
000195 //SORTJNF2  DD DISP=SHR,DSN=TTA.TAI23.VRS.TEMPCTRL(+1)                 
000196 //SORTOUT   DD DISP=(,CATLG,),DSN=TTA.TAI23.VRS.CTRL(+1),               
000197 //             SPACE=(TRK,(10,10),RLSE),                               
000198 //             DCB=(PTS.MODEL,RECFM=FB,LRECL=109),STORCLAS=SCTST,       
000199 //             MGMTCLAS=MCTST                                           
000200 //SYSIN     DD DISP=SHR,DSN=TTA.RAIPUMO.VRS.CTLCARD(TAIVLST2)           
000201 //*             


4. The sortcard

Code:
***************************** Top of Data **
 JOINKEYS FILES=F1,FIELDS=(41,4,D)           
 JOINKEYS FILES=F2,FIELDS=(1,4,D)           
 REFORMAT FIELDS=(F1:27,44,F2:45,65)         
 SORT FIELDS=COPY                           
**************************** Bottom of Data


5. JNF2

Code:
 ****** ***************************** Top of Data ******************************
 000001 POLM              |+00307799272148|+0000303578
 000002 CESS              |+00241172258705|+0000087257
 ****** **************************** Bottom of Data ****************************




6. Sortout (Final File)

Code:
 ****** ***************************** Top of Data ******************************
 000001 TTA.TAI23.VRS.POLMSTR.G0004V00              |+00307799272148|+0000303578
 000002 TTA.TAI23.VRS.CESSDATA.G0004V00             |+00241172258705|+0000087257
 ****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 07, 2010 5:37 pm
Reply with quote

Thanks for posting. I see that you have modified your program to introduce a 4 byte "key" in the output file to simulate a match for each filename.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Tue Dec 07, 2010 5:56 pm
Reply with quote

Couldn't find a much better option icon_smile.gif ...except Rexx which I dont know icon_sad.gif
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 7
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top