You get the following output which are the latest versions of the GDG files.
Code:
000001 1IDCAMS SYSTEM SERVICES
000002 0
000003 PRINT INFILE(DD1) COUNT(0) CHAR
000004 1IDCAMS SYSTEM SERVICES
000005 -LISTING OF DATA SET -TTA.TAI23.VRS.POLMSTR.SORT.G0008V00
000006 0IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
000007 0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
000008 1IDCAMS SYSTEM SERVICES
000009 0
000010 PRINT INFILE(DD2) COUNT(0) CHAR
000011 1IDCAMS SYSTEM SERVICES
000012 -LISTING OF DATA SET -TTA.TAI23.VRS.CESSDATA.SORT.G0008V00
000013 0IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
000014 0IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
000015 1IDCAMS SYSTEM SERVICES
000016 0
000017 0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE
****** **************************** Bottom of Data ****************
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
No need for another sort step to get the Latest version of the GDG name.
But I dont think it has given an advantage of "saving a step". As per your requirement, you need to extract the latest generation filename and fix it onto the data contained in another file.
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
dick,
My bad Used the more Colloquial and compact term to describe what i wanted to express!!
Below should apply for my above post.
Code:
C ALL 'VERSION' 'GENERATION'
Arun,
This saved my intermediate sort step where i was sorting my listcat output on descending order based on the generation number as listcat output was coming in ascending order, i mean the oldest generation first.
Now as i am getting the latest generation right away i can vertically merge both the files in the next step itself. So saved one sortcard.
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
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
***************************** 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 ****************************