Who can help me to pick up the last record in each partially duplicated group?
I have an sample input file with two fields, like this:
"PRCP","*ALIAS"
"PRCP.ACCT.BILLING.SUMMARY.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.MUNCIPAL.BILL.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.SUMMARY.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.SUMMARY.DOWNLOAD.D100202","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN","??????"
"PRCP.ADDRESS.UPDATE.TRAN.G0086V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0087V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0088V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0089V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0090V00","MIGRAT2"
"PRCP.ENRCNT.EXPN405S.T3407903","??????"
"PRCP.ENRCNT.EXPN405S.T3407903.G0001V00","MIGRAT2"
"PRCP.ENRCNT.EXTRCTRN.T3461240.TRN2701","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80","?????"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1158V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1159V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1160V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1161V00","MIGRAT2"
My program is like this:
Option Explicit
Private Sub Main()
Dim strName As String
Dim strRemark As String
Dim YGDG As String, YData As String, YVSAM As String
Static TotGDG As Integer, TotData As Integer
'
TotGDG = 0
TotData = 0
YVSAM = " "
YGDG = " "
YData = " "
Open App.Path & "\PRCP_IN3.txt" For Input As #5
Open App.Path & "\PRCP_OUT5.txt" For Output As #6
Do While Not EOF(5)
Input #5, strName, strRemark
If Right(strName, 3) <> "V00" Then
If strRemark = "??????" Then (or “?????”)
YGDG = "Y"
YData = " "
TotGDG = TotGDG + 1
Write #6, strName, strRemark, YGDG, YVSAM, YData
Else
YGDG = " "
YData = "Y"
TotData = TotData + 1
Write #6, strName, strRemark, YGDG, YVSAM, YData
End If
End If
Loop
Write #6, "PRCP Total GDG IS:", TotGDG
Write #6, "PRCP Total Data sets IS:", TotData
Close #5
Close #6
End Sub
This program works. It generated the output file:
"PRCP","*ALIAS"
"PRCP.ACCT.BILLING.SUMMARY.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.MUNCIPAL.BILL.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.SUMMARY.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.SUMMARY.DOWNLOAD.D100202","MIGRAT2"," "," ","Y"
"PRCP.ADDRESS.UPDATE.TRAN","??????","Y"," "," "
"PRCP.ADDRESS.UPDATE.TRAN"," "," "," "," "
"PRCP.ENRCNT.EXPN405S.T3407903","??????","Y"," "," "
"PRCP.ENRCNT.EXPN405S.T3407903"," "," "," "," "
"PRCP.ENRCNT.EXTRCTRN.T3461240.TRN2701","MIGRAT2"," "," ","Y"
"PRCP.ENRCNT.KEYDATA.LENGTH80","?????","Y"," "," "
"PRCP.ENRCNT.KEYDATA.LENGTH80"," "," "," "," "
"prcp Total GDG IS:",3
"prcp Total Data sets IS:",5
Actually, I really want to include the following 3 records, which my program did not pick up.
Who can add some coding to my program to let the following records be included in the output file?
"PRCP.ADDRESS.UPDATE.TRAN.G0090V00","MIGRAT2"
"PRCP.ENRCNT.EXPN405S.T3407903.G0001V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1161V00","MIGRAT2"
Any Help, Tip, Hint to solve this problem will be greatly appreciated. Chris
I have an sample input file with two fields, like this:
"PRCP","*ALIAS"
"PRCP.ACCT.BILLING.SUMMARY.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.MUNCIPAL.BILL.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.SUMMARY.DOWNLOAD","MIGRAT2"
"PRCP.ACCT.SUMMARY.DOWNLOAD.D100202","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN","??????"
"PRCP.ADDRESS.UPDATE.TRAN.G0086V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0087V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0088V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0089V00","MIGRAT2"
"PRCP.ADDRESS.UPDATE.TRAN.G0090V00","MIGRAT2"
"PRCP.ENRCNT.EXPN405S.T3407903","??????"
"PRCP.ENRCNT.EXPN405S.T3407903.G0001V00","MIGRAT2"
"PRCP.ENRCNT.EXTRCTRN.T3461240.TRN2701","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80","?????"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1158V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1159V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1160V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1161V00","MIGRAT2"
My program is like this:
Option Explicit
Private Sub Main()
Dim strName As String
Dim strRemark As String
Dim YGDG As String, YData As String, YVSAM As String
Static TotGDG As Integer, TotData As Integer
'
TotGDG = 0
TotData = 0
YVSAM = " "
YGDG = " "
YData = " "
Open App.Path & "\PRCP_IN3.txt" For Input As #5
Open App.Path & "\PRCP_OUT5.txt" For Output As #6
Do While Not EOF(5)
Input #5, strName, strRemark
If Right(strName, 3) <> "V00" Then
If strRemark = "??????" Then (or “?????”)
YGDG = "Y"
YData = " "
TotGDG = TotGDG + 1
Write #6, strName, strRemark, YGDG, YVSAM, YData
Else
YGDG = " "
YData = "Y"
TotData = TotData + 1
Write #6, strName, strRemark, YGDG, YVSAM, YData
End If
End If
Loop
Write #6, "PRCP Total GDG IS:", TotGDG
Write #6, "PRCP Total Data sets IS:", TotData
Close #5
Close #6
End Sub
This program works. It generated the output file:
"PRCP","*ALIAS"
"PRCP.ACCT.BILLING.SUMMARY.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.MUNCIPAL.BILL.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.SUMMARY.DOWNLOAD","MIGRAT2"," "," ","Y"
"PRCP.ACCT.SUMMARY.DOWNLOAD.D100202","MIGRAT2"," "," ","Y"
"PRCP.ADDRESS.UPDATE.TRAN","??????","Y"," "," "
"PRCP.ADDRESS.UPDATE.TRAN"," "," "," "," "
"PRCP.ENRCNT.EXPN405S.T3407903","??????","Y"," "," "
"PRCP.ENRCNT.EXPN405S.T3407903"," "," "," "," "
"PRCP.ENRCNT.EXTRCTRN.T3461240.TRN2701","MIGRAT2"," "," ","Y"
"PRCP.ENRCNT.KEYDATA.LENGTH80","?????","Y"," "," "
"PRCP.ENRCNT.KEYDATA.LENGTH80"," "," "," "," "
"prcp Total GDG IS:",3
"prcp Total Data sets IS:",5
Actually, I really want to include the following 3 records, which my program did not pick up.
Who can add some coding to my program to let the following records be included in the output file?
"PRCP.ADDRESS.UPDATE.TRAN.G0090V00","MIGRAT2"
"PRCP.ENRCNT.EXPN405S.T3407903.G0001V00","MIGRAT2"
"PRCP.ENRCNT.KEYDATA.LENGTH80.G1161V00","MIGRAT2"
Any Help, Tip, Hint to solve this problem will be greatly appreciated. Chris