View previous topic :: View next topic |
Author |
Message |
ldushkin Beginner
Joined: 05 Apr 2006 Posts: 56 Topics: 20
|
Posted: Wed Apr 05, 2006 10:35 am Post subject: I would like to learn EASYTRIEVE in JCL |
|
|
I would like to learn EASYTRIEVE in JCL. Please help me. I have one flat file with Lrecl=224, and i need to eliminate duplicate in col 47, 5 bytes |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Apr 05, 2006 11:14 am Post subject: |
|
|
Quote: |
I have one flat file with Lrecl=224, and i need to eliminate duplicate in col 47, 5 bites
|
Basically you need to learn Easytrieve language first. JCL is just for identifying the job to operating system. JCL by it self cannot do anything.
What is the format of the contents at pos 47 for 5 bytes? Is it a character/numeric(packed/binary/zoned) ?
Also when you say eliminate dups do you want to completely remove all the duplicate entries or keep the first record of the duplicate and delete the other dups?
ex: assume you have the data as follows
Code: |
ABC
ABC -DUP1
ABC -DUP2
DEF
EFG
EFG -DUP1
|
Now do you want the output to look like this ?
or
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ldushkin Beginner
Joined: 05 Apr 2006 Posts: 56 Topics: 20
|
Posted: Thu Apr 06, 2006 8:32 am Post subject: |
|
|
Thank you,
I have character field.
Also I need the total count records of input file.
Example:
xxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxx xxxxR11111xxxxxxxxx
xxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxx xxxxR11111xxxxxxxxx
xxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxx xxxxR22222xxxxxxxxx
xxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxx xxxxR22222xxxxxxxxx
xxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxx xxxxR33333xxxxxxxxx
TOTAL RECORDS: 216
R1111
R2222
R3333 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 06, 2006 9:12 am Post subject: |
|
|
ldushkin,
Try this
Code: |
//STEP0100 EXEC PGM=EZTPA00
//STEPLIB DD DSN=EASYTREV.LOADLIB,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSSNAP DD SYSOUT=*
//INFILE DD DSN=YOUR INPUT FILE,
// DISP=SHR
//OUTFILE DD SYSOUT=*,LRECL=80
//SYSIN DD *
FILE INFILE
IN-KEY 47 05 A
FILE OUTFILE FB(0 0)
OUT-REC 01 80 A
OUT-KEY 01 05 A
OUT-REC-CNT 16 09 N
JOB INPUT (INFILE KEY(IN-KEY)) FINISH DISP
IF FIRST-DUP INFILE OR NOT DUPLICATE INFILE
OUT-KEY = IN-KEY
PUT OUTFILE
END-IF
DISP. PROC
OUT-REC = 'TOTAL RECORDS: '
OUT-REC-CNT = RECORD-COUNT
PUT OUTFILE
END-PROC
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ldushkin Beginner
Joined: 05 Apr 2006 Posts: 56 Topics: 20
|
Posted: Sat Apr 08, 2006 5:21 am Post subject: |
|
|
I appreciate all your help |
|
Back to top |
|
|
ldushkin Beginner
Joined: 05 Apr 2006 Posts: 56 Topics: 20
|
Posted: Wed Apr 19, 2006 8:08 am Post subject: |
|
|
Hi,
I got error
1 IN-KEY 47 05 A
1 *******B014 UNABLE TO RECOGNIZE STATEMENT
thank you |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Apr 19, 2006 8:27 am Post subject: |
|
|
ldushkin,
You are missing the FILE Statement before the IN-KEY definition. Please read carefully the posts and copy the code clearly
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|