MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I would like to learn EASYTRIEVE in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 05, 2006 10:35 am    Post subject: I would like to learn EASYTRIEVE in JCL Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Wed Apr 05, 2006 11:14 am    Post subject: Reply with quote

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 ?

Code:

ABC
DEF
EFG


or

Code:

DEF


Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Thu Apr 06, 2006 8:32 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Thu Apr 06, 2006 9:12 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Sat Apr 08, 2006 5:21 am    Post subject: Reply with quote

I appreciate all your help
Back to top
View user's profile Send private message
ldushkin
Beginner


Joined: 05 Apr 2006
Posts: 56
Topics: 20

PostPosted: Wed Apr 19, 2006 8:08 am    Post subject: Reply with quote

Hi,

I got error


1 IN-KEY 47 05 A
1 *******B014 UNABLE TO RECOGNIZE STATEMENT

thank you
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Wed Apr 19, 2006 8:27 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group