από mari@pi mari@pi στις 2008-04-15 13:47 tags mainframe , προγραμματισμός
wait..Voting.. bad good
icetool splice (output not unique)
The proc :
//MAIPROC PROC INFILE=XXXXXX,OUTFILE=XXXXXX,ICETLIN=XXXXXX,
// CTL1=XXXXXX,CTL2=XXXXXX,CTL3=XXXXXX,CTL4= XXXXXX,
// CTL5=XXXXXX,CTL6=XXXXXX,CTL7=XXXXXX
//*****UNLOAD*SELECTED*ID****DATA*FILE***FROM****D​​​​​B2*********
//STPUNLD EXEC PDB2
//SYSUDUMP DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSTSIN DD DSN=MAI.SQL.SYSTSIN(SQL1),DISP=SHR
//SYSREC00 DD DSN=&&SELCTID,
// SPACE=(1024,(10,10)),DISP=(NEW,PASS)
//SYSREC01 DD DSN=&&SYSREC01,
// SPACE=(1024,(10,10)),DISP=(NEW,DELETE)
//SYSPUNCH DD DSN=&&SYSPUNCH,
// SPACE=(800,(15,15)),DISP=(NEW,DELETE)
//SYSIN DD DSN=MAI.TEST.SYSIN(CMODSQL1),DISP=SHR
//*-----------------------------------------------​​​​​-------*
//*---OMIT-RECORDS-TOY-IN1-*<>*-SELECTED--ID​​​​​S-STO-IN2----*
//*-----IN1---ALL-RECORDS----NOT-UNIQUE-ID--------​​​​​-------*
//*-----IN2---SELECTED--IDS-------------------CHAR​​​​​(4)----*
//*-----OUT1---:IN IN1 (AND) NOT IN IN2------------------*
//*-----------*******-19112007--------------------​​​​​-------*
// IF STPUNLD.G.RC<=4 THEN
//STEPICE EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=&INFILE.,DISP=SHR
//IN2 DD DSN=&&SELCTID,DISP=(SHR,DELETE)
//***
//I2 DD DSN=&&I2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP =(MOD,DELETE)
//F1 DD DSN=&&F1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP =(MOD,DELETE)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP =(MOD,DELETE)
//TMPOUT1 DD DSN=&&TMPOUT1,UNIT=SYSDA,SPACE=(CYL,(5,5))​​​​​,
// DISP=(MOD,DELETE)
//****
//OUT1 DD DSN=&OUTFILE.,DISP=SHR
//TOOLIN DD DSN=&ICETLIN.,DISP=SHR
//*
//CTL1CNTL DD DSN=&CTL1.,DISP=SHR
//CTL2CNTL DD DSN=&CTL2.,DISP=SHR
//CTL3CNTL DD DSN=&CTL3.,DISP=SHR
//CTL4CNTL DD DSN=&CTL4.,DISP=SHR
//CTL5CNTL DD DSN=&CTL5.,DISP=SHR
//CTL6CNTL DD DSN=&CTL6.,DISP=SHR
//CTL7CNTL DD DSN=&CTL7.,DISP=SHR
// ENDIF

The jobaki :
//MAIJOBA EXEC MAIPROC,
// INFILE=MAI.DATA.ALLPRNT,
// OUTFILE=MAI.DATA.TOPRINT,
// ICETLIN=MAI.TEST.SYSIN(TOOLIN),
// CTL1=MAI.TEST.CCARD(MCTL1),
// CTL2=MAI.TEST.CCARD(MCTL2),
// CTL3=MAI.TEST.CCARD(MCTL3),
// CTL4=MAI.TEST.CCARD(MCTL4),
// CTL5=MAI.TEST.CCARD(MCTL5),
// CTL6=MAI.TEST.CCARD(MCTL6),
// CTL7=MAI.TEST.CCARD(MCTL7)

The ccards :     (εδώ INFILE - ID (38,4,CH) μήκος αρχείου 255)
ICETLIN
000001 COPY FROM(IN2) TO(I2) USING(CTL1)
000002 SELECT FROM(IN1) TO(F1) ON(38,4,CH) FIRST
000003 SELECT FROM(I2) TO(F1) ON(38,4,CH) FIRST
000004 SELECT FROM(F1) TO(T1) ON(38,4,CH) FIRSTDUP USING(CTL2)
000005 SELECT FROM(F1) TO(T1) ON(38,4,CH) NODUPS USING(CTL3)
000006 COPY FROM(IN1) TO(T1) USING(CTL4)
000007 COPY FROM(I2) TO(T1) USING(CTL5)
000008 SPLICE FROM(T1) TO(TMPOUT1) ON(38,4,CH) -
000009 WITHALL WITH(1,256) USING(CTL6)
000010 SORT FROM(TMPOUT1) TO(OUT1) USING(CTL7)
CTL1
000001 OUTREC FIELDS=(38:1,4)
CTL2
000001 OUTFIL FNAMES=T1,OVERLAY=(256:C'DD')
CTL3
000001 OUTFIL FNAMES=T1,OVERLAY=(256:C'UU')
CTL4
000001 OUTFIL FNAMES=T1,OVERLAY=(256:C'11')
CTL5
000001 OUTFIL FNAMES=T1,OVERLAY=(256:C'22')
CTL6
000001 OUTFIL FNAMES=TMPOUT1,INCLUDE=(256,2,CH,EQ,C'1U'),
000002 BUILD=(1,255)
CTL7
000001 SORT FIELDS=(9,4,CH,A,38,4,CH,A)

στη περίπτωση που το πεδίο ID είναι σε μορφή packed μέσα στο αρχείο INFILE
The ccards :    (εδώ INFILE - ID (1,3,PD) μήκος αρχείου 400)
ICETLIN
000001 COPY FROM(IN2) TO(I2) USING(CTL1)
000002 SELECT FROM(IN1) TO(F1) ON(1,3,PD) FIRST
000003 SELECT FROM(I2) TO(F1) ON(1,3,PD) FIRST
000004 SELECT FROM(F1) TO(T1) ON(1,3,PD) FIRSTDUP USING(CTL2)
000005 SELECT FROM(F1) TO(T1) ON(1,3,PD) NODUPS USING(CTL3)
000006 COPY FROM(IN1) TO(T1) USING(CTL4)
000007 COPY FROM(I2) TO(T1) USING(CTL5)
000008 SPLICE FROM(T1) TO(TMPOUT1) ON(1,3,PD) -
000009 WITHALL WITH(1,401) USING(CTL6)
000010 SORT FROM(TMPOUT1) TO(OUT1) USING(CTL7)
CTL1
000001 OUTREC FIELDS=(1:1,4,ZD,TO=PD,LENGTH=3)
CTL2-3-4-5-6  παρόμοιες με παραπάνω*same as above
CTL7
000001 SORT FIELDS=(136,4,CH,A,1,3,PD,A)


οοουφ σοοόρταρα ,,