Page 2 of 2

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Thu Aug 26, 2010 11:01 pm
by Frank Yaeger
Here's a DFSORT/ICETOOL job that will do what I think you asked for.

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  sequential input file (FB/25)
//IN2 DD DSN=...  VSAM file
//T2 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT  DD DSN=...  VSAM file
//TOOLIN DD *
COPY FROM(IN2) TO(T2) VSAMTYPE(F)
MERGE FROM(IN1,T2) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION EQUALS,ZDPRINT
  MERGE FIELDS=(1,10,BI,A)
  SUM FIELDS=(11,15,ZD)
/*

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 12:17 am
by dick scherrer
Hello,

Any solution for my problem???
As they say "Patience is a virtue". . .

I was just trying to get enough information posted so that everyone would have the same understanding of the requirement. I usually don't provide "sort solutions" here as we have the people who write/maintain the dfsort product participating in the forum ;)

d

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 1:24 am
by ajuatsgp
Hi,
It's true that Patience is a virtue.
But if I am not getting any solution in next 5-6 hrs I need to write a COBOL pgm,for this. And I really don't want to write a pgm for this.
Let me wait with my fingers crossed.

Thanks

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 1:34 am
by ajuatsgp
Hi Frank,
I am really sorry but I think the answer u have given is that fullfil my requirement.Have you gone through all the details I have provided.I guess whatever u have answered is just after reading the subject line.
I am sorry again as if your answer covers my requirement I am not able to understand that.

Thanks

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 3:14 am
by enrico-sorichetti
But if I am not getting any solution in next 5-6 hrs I need to write a COBOL pgm,for this. And I really don't want to write a pgm for this.

the most inappropriate/stupid thing to say on a help forum. Your urgency is just that... yours

remember, answering is on voluntary basis, on responders time and at no charge
if You are lazy, and/or have a strict time constraint the best approach would be to hire a paid <third party> person to do the job

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 3:23 am
by dick scherrer
Hello,

I am sorry again as if your answer covers my requirement I am not able to understand that.
Your time would be better spent running a test with the solution provided rather than worrying if your requirement was understood.

If you run a test and it works, post back that it works. If the test does not work, post back with what happened.

And to repeat what Enrico said - it is not a good practice to bring something urgent to a free forum. It you are paying for support, maybe, but our forum does not provide for urgent. . .

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 3:26 am
by Frank Yaeger
I am really sorry but I think the answer u have given is that fullfil my requirement.Have you gone through all the details I have provided.I guess whatever u have answered is just after reading the subject line.
I am sorry again as if your answer covers my requirement I am not able to understand that.


Huh? I certainly did read through the entire thread and gave you a solution based on what I thought you were asking for. Have you actually tried my solution?

Since we can't sort or merge VSAM and non-VSAM data sets together in one pass, I'm copying the VSAM file to a temporary sequential file, merging the two sequential files, and writing the merged records to the VSAM data set. I'm using SUM to total the amounts for dup records.

If this doesn't work for you, then you haven't explained clearly what you want to do.

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 3:10 pm
by ajuatsgp
Hi,
I have coded as follow:
RX98D1C5
COPY FROM(RXHSTF) TO(TEMPDD) VSAMTYPE(F)
MERGE FROM(BLCNTDD,TEMPDD) TO(OUTFIL) USING(CTL2)

RX98D1C6
OPTION EQUALS,ZDPRINT
MERGE FIELDS=(1,10,BI,A)
SUM FIELDS=(11,15,ZD)


//X98D1600 EXEC PGM=ICETOOL,
// COND=(0,NE)
//*
// INCLUDE MEMBER=SYSOUTS
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD DSN=&PARMLIB1(RX98D1C5),DISP=SHR
//CTL2CNTL DD DSN=&PARMLIB1(RX98D1C6),DISP=SHR
//*
//BLCNTDD DD DSN=Seq file,
// DISP=SHR
//RXHSTF DD DSN=VSAM file,
// DISP=SHR
//TEMPDD DD DSN=Temp file,
// MGMTCLAS=&MD,DATACLAS=&D2,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=25)
//OUTFIL DD DSN=VSAM file,
// DISP=SHR


but I am getting error as:
ICE630I 0 MODE IN EFFECT: STOP

COPY FROM(RXHSTF) TO(TEMPDD) VSAMTYPE(F)
ICE627I 0 DFSORT CALL 0001 FOR COPY FROM RXHSTF TO TEMPDD COMPLETED
ICE602I 0 OPERATION RETURN CODE: 00

MERGE FROM(BLCNTDD,TEMPDD) TO(OUTFIL) USING(CTL2)
$
ICE614A 0 INVALID OPERATOR
ICE602I 0 OPERATION RETURN CODE: 12

Then I tried with giving a colon after the copy statement which I know is not correct, then also I got error as follow:
ICE630I 0 MODE IN EFFECT: STOP

COPY FROM(RXHSTF) TO(TEMPDD) VSAMTYPE(F) -
MERGE FROM(BLCNTDD,TEMPDD) TO(OUTFIL) USING(CTL2)
$
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER


please let me know where is the issue???

Re: Repro from sequential to VSAM file handeling the duplicate

PostPosted: Fri Aug 27, 2010 8:49 pm
by Frank Yaeger
This indicates you don't have the DFSORT PTF that supports the MERGE operator. Ask your System Programmer to install z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009).

Alternatively, you can use two DFSORT steps like this:

//S1    EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  VSAM file
//SORTOUT DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN DD *
  OPTION COPY
  RECORD TYPE=F
//S2    EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=...  sequential input file (FB/25)
//SORTIN02 DD DSN=&&T2,DISP=(OLD,PASS)
//SORTOUT  DD DSN=...  VSAM file
//SYSIN DD *
  OPTION EQUALS,ZDPRINT
  MERGE FIELDS=(1,10,BI,A)
  SUM FIELDS=(11,15,ZD)
/*