Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Required : Easytrieve Material with program examples

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
Hames

New User


Joined: 03 Oct 2005
Posts: 49

PostPosted: Mon Nov 21, 2005 4:16 pm    Post subject: Required : Easytrieve Material with program examples
Reply with quote

Hi,

I am in need of Easytrieve material.

If anyone knows some thing having progarammatical examples Please let me know.

Regards,
Hames
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Nov 22, 2005 4:53 pm    Post subject:
Reply with quote

Hi Hames,


Check out this example

//T6327PGZ JOB (,1704),'MISSED RETRO',CLASS=B,NOTIFY=T6327PG
//***********************************************************************
//* INSERT approved hs codes *
//**********************************************************************
//STPPRMS EXEC UCC11RMS,TYPRUN=F
//*
//STEP010 EXEC PGM=EZTPA00
//STEPLIB DD DSN=CORP.EASYTREV.PROD.LOADLIB,DISP=SHR
//*ILEA DD DSN=T6327PG.BCST222A.DBCR.SMALL.FILE,DISP=SHR
//FILEA DD DSN=T4551SD.BCST222A.RECYCLE.FILE1,DISP=SHR
//FILEC DD DSN=T6327PG.SR3927.OFPERIOD.FILE,
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=FBMED,
// LRECL=200,
// UNIT=PROD
//FILEB DD DSN=T6327PG.SR3927.NOTFND.FILE,
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=FBMED,
// LRECL=250,
// UNIT=PROD
//FILEDR DD DUMMY
//*
//FILEER DD DUMMY
//*
//SYSPRINT DD DSN=T6327PG.SR3927.DIFFRENC.FILE,
// DISP=(NEW,CATLG,DELETE),
// DATACLAS=FBMED,
// LRECL=250,
// UNIT=PROD
//*
//SYSSNAP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD * 0000000
LIST OFF
*REPORT WITH DISPLAYS INSTEAD OF REPORT
*PARM LIST(NOPARM NOFILE)
*
**************************************************************
* INPUT FILE RECORD FOR CAP INPUT FILE
**************************************************************
FILE FILEA
CAP-RECORD 001 200 A
CAP-SPLR 001 005 A
CAP-PKSLP 006 015 A
CAP-PART 021 018 A
CAP-RETRO-AMOUNT 039 014 N 2 MASK '-----------9.99'
CAP-CURNCY 053 003 A
CAP-EX-RATE 056 004 N 3
CAP-D-MATL-SHIP 063 008 A
CAP-DBCR-FLAG 071 001 A
CAP-FILLER 072 129 A

**************************************************************
* OUTPUT FILE RECORDS
**************************************************************
FILE FILEB
RECB 001 225 A
RECB-DISC 001 200 A
RECB-COMMENT 201 050 A
*
FILE FILEC
RECC 001 200 A
*
FILE FILEDR PRINTER F(245)
*
FILE FILEER PRINTER F(245)
*
* WORKING STORAGE
**************************************************************
CUR-DATE W 10 A
CUR-MONTH-YYYY CUR-DATE 04 N
CUR-FILLER1 CUR-DATE +4 01 A
CUR-MONTH-MM CUR-DATE +5 02 N
CUR-FILLER2 CUR-DATE +7 01 A
CUR-MONTH-DD CUR-DATE +8 02 N

WS-C-PART-PRC-SRCE W 02 A
WS-A-PART-VAL-REC-PRC W 08 P
WS-A-PART-IMPT-VAL W 08 P
WS-A-PART-IMPT-VAL1 W 14 N MASK '-------------9'
WS-A-TOOL-FACTR W 08 P 06
WS-A-PART-DIFF-VAL W 08 P
WS-I-SUPLR-LOC-REL W 07 A
WS-I-PKSLIP-SUPLR W 16 A
WS-I-PART-OR-CNTNR W 10 A
WS-I-LINE W 02 P
WS-I-LINE1 W 03 N MASK '--9'
WS-I-SEQ W 03 P
WS-I-SEQ1 W 04 N MASK '---9'
WS-C-CNTRY-ORGN W 02 A
WS-C-SPCL-CALC-DUTY W 02 A
WS-C-HARMZD-PRE W 06 A
WS-C-HARMZD-SUFF W 04 A
WS-I-RECON-ENTRY-ID W 11 A
WS-A-RECON-EXTD-VFD W 07 P 2
* WS-A-RECON-EXTD-VFD1 W 14 N 2 MASK '-----------9.99'
WS-A-RECON-EXTD-VFD1 W 12 N MASK '-----------9'
WS-A-RECON-RETRO-PRC W 07 P 2
WS-A-RECON-RETRO-PRC1 W 14 N 2 MASK '-----------9.99'
WS-P-DUTY-LINE-RATE W 07 P 8
WS-P-DUTY-LINE-RATE1 W 14 N 8 MASK '-----9.99999999'
WS-A-DUTY-LINE-TOT-PD W 07 P 2
WS-A-DUTY-LINE-TOT-PD1 W 14 N 2 MASK '-----------9.99'
WS-A-LINE-MDSE-PRCF W 07 P 2
WS-A-LINE-MDSE-PRCF1 W 14 N 2 MASK '-----------9.99'
WS-D-SHPMT-EXPRT W 10 A
WS-D-MDSE-IMPORT-US W 10 A
WS-I-TRAN-CSTM W 11 A
WS-I-INVC W 16 A

WS-C-HARMZD-FULL W 10 A
WS-C-HARMZD-FULL-PRE WS-C-HARMZD-FULL 06 A
WS-C-HARMZD-FULL-SUF WS-C-HARMZD-FULL +6 04 A
WS-O-RETR-TOT-AMT W 14 N 02 MASK '-----------9.99'
WS-N-RETR-TOT-AMT W 14 N 02 MASK '-----------9.99'
WS-DIFF-RET-AMT W 14 N 02 MASK '-----------9.99'
WS-CAP-CURNCY W 03 A
* WS-CAP-RET-AMT-CONVT W 08 P 06
WS-CAP-RET-AMT-CONVT W 14 N 02 MASK '-----------9.99'
MAX-DATE-FOUND W 01 N VALUE 0
EXCH-RATE-FOUND W 01 N VALUE 0
WS-MAX-DATE W 10 A
WS-EXCH-RATE W 05 P 06
WS-EXPORT-DATE W 10 A
WS-CNTRY-IMPT W 02 A

WS-TXN-MSG W 50 A
WS-TXN-ENT-NBR WS-TXN-MSG 11 A
WS-TXN-ERR-MSG WS-TXN-MSG +11 21 A
WS-TXN-FILLER WS-TXN-MSG +32 18 A

WS-INVC-MSG W 50 A
WS-INVC-ENT-NBR WS-INVC-MSG 11 A
WS-INVC-FILLER WS-INVC-MSG +11 01 A
WS-INVC-INVC-NBR WS-INVC-MSG +12 16 A
WS-INVC-ERR-MSG WS-INVC-MSG +28 22 A
***************REPORT VARIABLES **********************

DESCRIPTION W 35 A

***************TOTAL TRANS IN PHISRRD**********************

SQL DECLARE CSR_A CURSOR FOR +
SELECT I_TRAN_CSTM +
,I_SUPLR_LOC_REL +
,I_PKSLIP_SUPLR +
,I_PART_OR_CNTNR +
,C_PART_PRC_SRCE +
,A_PART_IMPT_VAL +
,A_TOOL_FACTR +
,A_PART_DIFF_VAL +
FROM ODDCDB2P.P.PUSHRPY +
WHERE I_SUPLR_LOC_REL = :CAP-SPLR AND +
I_PKSLIP_SUPLR = :CAP-PKSLP AND +
I_PART_OR_CNTNR = :CAP-PART AND +
C_TRAN_STAT = 'X'

SQL DECLARE CSR_B CURSOR FOR +
SELECT I_INVC +
,I_SUPLR_LOC_REL +
,I_PKSLIP_SUPLR +
,I_PART_OR_CNTNR +
,I_LINE +
,I_SEQ +
,C_CNTRY_ORGN +
,C_SPCL_CALC_DUTY +
,C_HARMZD_PRE +
,C_HARMZD_SUFF +
,I_RECON_ENTRY_ID +
,A_RECON_EXTD_VFD +
,P_DUTY_LINE_RATE +
,A_DUTY_LINE_TOT_PD +
,A_LINE_MDSE_PRCF +
,A_RECON_RETRO_PRC +
FROM ODDCDB2P.P.PUSHTXN +
WHERE I_TRAN_CSTM = :WS-I-TRAN-CSTM AND +
I_SUPLR_LOC_REL = :WS-I-SUPLR-LOC-REL AND +
I_PKSLIP_SUPLR = :WS-I-PKSLIP-SUPLR AND +
I_PART_OR_CNTNR = :WS-I-PART-OR-CNTNR AND +
C_TRAN_STAT = 'L'

SQL DECLARE CSR_C CURSOR FOR +
SELECT D_SHPMT_EXPRT +
,D_MDSE_IMPORT_US +
,I_TRAN_CSTM +
FROM ODDCDB2P.P.PUSINVC +
WHERE I_TRAN_CSTM = :WS-I-TRAN-CSTM AND +
I_INVC = :WS-I-INVC AND +
C_TRAN_STAT = 'L'

*
SQL DECLARE D2 CURSOR FOR +
SELECT +
MAX (D_EFFCTV) +
FROM +
ODDCDB2P.P.PCUEXRT +
WHERE +
C_CURNCY_ISO = :WS-CAP-CURNCY +
AND C_CNTRY_IMPT = :WS-CNTRY-IMPT +
AND D_EFFCTV <= :WS-EXPORT-DATE
*
SQL DECLARE D3 CURSOR FOR +
SELECT +
P_CURNCY_EXCHNG +
FROM +
ODDCDB2P.P.PCUEXRT +
WHERE +
C_CURNCY_ISO = :WS-CAP-CURNCY +
AND C_CNTRY_IMPT = :WS-CNTRY-IMPT +
AND D_EFFCTV = :WS-MAX-DATE
*
JOB INPUT FILEA START START-PARA FINISH FINISH-PARA

PERFORM 1000-GET-PUSHRPY-DATA

1000-GET-PUSHRPY-DATA. PROC 32000000

SQL OPEN CSR_A 32030000

SQL FETCH CSR_A + 32030000
INTO :WS-I-TRAN-CSTM +
,:WS-I-SUPLR-LOC-REL +
,:WS-I-PKSLIP-SUPLR +
,:WS-I-PART-OR-CNTNR +
,:WS-C-PART-PRC-SRCE +
,:WS-A-PART-IMPT-VAL +
,:WS-A-TOOL-FACTR +
,:WS-A-PART-DIFF-VAL

CASE SQLCODE
WHEN 0
PERFORM 2000-GET-PUSHTXN-DATA
WHEN -811
PERFORM 2000-GET-PUSHTXN-DATA
WHEN 100
MOVE ' REC NOT FOUND IN PUSHRPY' TO RECB-COMMENT
PERFORM 1500-WRITE-NOT-FOUND-FILE
OTHERWISE
* DISPLAY 'SQLCODE = ' SQLCODE
* DISPLAY 'CURSOR = CSR_A'
STOP EXECUTE
END-CASE

SQL CLOSE CSR_A 32330000

END-PROC

1500-WRITE-NOT-FOUND-FILE. PROC

MOVE CAP-RECORD TO RECB-DISC
PUT FILEB

END-PROC


2000-GET-PUSHTXN-DATA. PROC 32000000

SQL OPEN CSR_B 32030000

SQL FETCH CSR_B + 32030000
INTO :WS-I-INVC +
,:WS-I-SUPLR-LOC-REL +
,:WS-I-PKSLIP-SUPLR +
,:WS-I-PART-OR-CNTNR +
,:WS-I-LINE +
,:WS-I-SEQ +
,:WS-C-CNTRY-ORGN +
,:WS-C-SPCL-CALC-DUTY +
,:WS-C-HARMZD-PRE +
,:WS-C-HARMZD-SUFF +
,:WS-I-RECON-ENTRY-ID +
,:WS-A-RECON-EXTD-VFD +
,:WS-P-DUTY-LINE-RATE +
,:WS-A-DUTY-LINE-TOT-PD +
,:WS-A-LINE-MDSE-PRCF +
,:WS-A-RECON-RETRO-PRC

CASE SQLCODE
WHEN 0
PERFORM 3000-GET-PUSINVC-DATA
WHEN -811
PERFORM 3000-GET-PUSINVC-DATA
WHEN 100
MOVE WS-I-TRAN-CSTM TO WS-TXN-ENT-NBR
MOVE ' NOT FOUND IN PUSHTXN' TO WS-TXN-ERR-MSG
MOVE SPACES TO WS-TXN-FILLER
MOVE WS-TXN-MSG TO RECB-COMMENT
PERFORM 1500-WRITE-NOT-FOUND-FILE
OTHERWISE
* DISPLAY 'SQLCODE = ' SQLCODE
* DISPLAY 'CURSOR = CSR_B'
STOP EXECUTE
END-CASE

SQL CLOSE CSR_B 32330000

END-PROC

3000-GET-PUSINVC-DATA. PROC 32000000

SQL OPEN CSR_C 32030000

SQL FETCH CSR_C + 32030000
INTO :WS-D-SHPMT-EXPRT +
,:WS-D-MDSE-IMPORT-US +
,:WS-I-TRAN-CSTM

CASE SQLCODE
WHEN 0
IF (WS-D-MDSE-IMPORT-US < '2003-08-01' OR +
WS-D-MDSE-IMPORT-US > '2004-07-01')
PERFORM 3600-WRITE-OOP-FILE
ELSE
PERFORM 3700-EDIT-FIELDS-PARA
IF EXCH-RATE-FOUND = 1
PERFORM 3800-WRITE-REPORT-PARA
END-IF
END-IF
WHEN 100
MOVE WS-I-TRAN-CSTM TO WS-INVC-ENT-NBR
MOVE SPACES TO WS-INVC-FILLER
MOVE WS-I-INVC TO WS-INVC-INVC-NBR
MOVE ' NOT FOUND IN PUSINVC' TO WS-INVC-ERR-MSG
MOVE WS-INVC-MSG TO RECB-COMMENT
PERFORM 1500-WRITE-NOT-FOUND-FILE
OTHERWISE
* DISPLAY 'SQLCODE = ' SQLCODE
* DISPLAY 'CURSOR = CSR_C'
STOP EXECUTE
END-CASE

SQL CLOSE CSR_C 32330000

END-PROC

3600-WRITE-OOP-FILE. PROC

MOVE CAP-RECORD TO RECC
PUT FILEC

END-PROC

3700-EDIT-FIELDS-PARA. PROC

IF (CAP-CURNCY = 'US' OR CAP-CURNCY = 'USD' +
OR CAP-CURNCY = 'US ' OR CAP-CURNCY = ' US')
MOVE 'USD' TO WS-CAP-CURNCY
END-IF
*
IF (CAP-CURNCY = 'CA' OR CAP-CURNCY = 'CAD' +
OR CAP-CURNCY = 'CA ' OR CAP-CURNCY = ' CA')
MOVE 'CAD' TO WS-CAP-CURNCY
END-IF
*
IF WS-CAP-CURNCY = 'USD'
WS-CAP-RET-AMT-CONVT = CAP-RETRO-AMOUNT
EXCH-RATE-FOUND = 1
ELSE
EXCH-RATE-FOUND = 0
WS-EXCH-RATE = 0
MOVE WS-D-SHPMT-EXPRT TO WS-EXPORT-DATE
MOVE 'US' TO WS-CNTRY-IMPT
PERFORM GET-EXCHRATE-PARA
IF EXCH-RATE-FOUND = 1
WS-CAP-RET-AMT-CONVT = CAP-RETRO-AMOUNT * WS-EXCH-RATE
END-IF
END-IF
MOVE WS-C-HARMZD-PRE TO WS-C-HARMZD-FULL-PRE
MOVE WS-C-HARMZD-SUFF TO WS-C-HARMZD-FULL-SUF
*
WS-A-PART-VAL-REC-PRC = WS-A-PART-IMPT-VAL + WS-A-RECON-RETRO-PRC
IF WS-A-PART-VAL-REC-PRC <= 0
MOVE 0 TO WS-O-RETR-TOT-AMT
ELSE
WS-O-RETR-TOT-AMT ROUNDED = WS-A-RECON-RETRO-PRC
END-IF
*
WS-N-RETR-TOT-AMT ROUNDED = WS-CAP-RET-AMT-CONVT
WS-DIFF-RET-AMT ROUNDED = +
(WS-N-RETR-TOT-AMT - WS-O-RETR-TOT-AMT)

END-PROC

GET-EXCHRATE-PARA. PROC
*--------------------------------------------------------------------
MAX-DATE-FOUND = 0
SQL OPEN D2
SQL FETCH D2 INTO :WS-MAX-DATE
CASE SQLCODE
WHEN 0
MAX-DATE-FOUND = 1
WHEN 100
MOVE 'DATE NOT FOUND IN PCUEXRT' TO RECB-COMMENT
PERFORM 1500-WRITE-NOT-FOUND-FILE
OTHERWISE
STOP EXECUTE
END-CASE

SQL CLOSE D2
IF MAX-DATE-FOUND = 1
SQL OPEN D3
SQL FETCH D3 INTO :WS-EXCH-RATE
CASE SQLCODE
WHEN 0
EXCH-RATE-FOUND = 1
WHEN 100
MOVE 'RATE NOT FOUND IN PCUEXRT' TO RECB-COMMENT
PERFORM 1500-WRITE-NOT-FOUND-FILE
OTHERWISE
STOP EXECUTE
END-CASE
SQL CLOSE D3
ELSE
EXCH-RATE-FOUND = 0
END-IF

END-PROC
*

3800-WRITE-REPORT-PARA. PROC

IF WS-DIFF-RET-AMT EQ 0
PERFORM 4000-WRITE-REPORT1
ELSE
PERFORM 5000-WRITE-REPORT2
END-IF

END-PROC

4000-WRITE-REPORT1. PROC

WS-A-PART-IMPT-VAL1 = WS-A-PART-IMPT-VAL
WS-A-RECON-EXTD-VFD1 = WS-A-RECON-EXTD-VFD
WS-P-DUTY-LINE-RATE1 = WS-P-DUTY-LINE-RATE
WS-A-DUTY-LINE-TOT-PD1 = WS-A-DUTY-LINE-TOT-PD
WS-A-LINE-MDSE-PRCF1 = WS-A-LINE-MDSE-PRCF
WS-I-LINE1 = WS-I-LINE
WS-I-SEQ1 = WS-I-SEQ
*
DISPLAY WS-D-MDSE-IMPORT-US ',' +
WS-I-TRAN-CSTM ',' +
WS-I-SUPLR-LOC-REL ',' +
WS-I-PKSLIP-SUPLR ',' +
WS-I-PART-OR-CNTNR ',' +
WS-I-LINE ',' +
WS-I-SEQ ',' +
WS-C-CNTRY-ORGN ',' +
WS-C-SPCL-CALC-DUTY ',' +
WS-C-HARMZD-FULL ',' +
WS-I-RECON-ENTRY-ID ',' +
WS-C-PART-PRC-SRCE ',' +
WS-A-PART-IMPT-VAL1 ',' +
WS-A-RECON-EXTD-VFD1 ',' +
WS-O-RETR-TOT-AMT ',' +
WS-N-RETR-TOT-AMT ',' +
WS-DIFF-RET-AMT ',' +
WS-P-DUTY-LINE-RATE1 ',' +
WS-A-DUTY-LINE-TOT-PD1 ',' +
WS-A-LINE-MDSE-PRCF1

END-PROC

5000-WRITE-REPORT2. PROC

WS-A-PART-IMPT-VAL1 = WS-A-PART-IMPT-VAL
WS-A-RECON-EXTD-VFD1 = WS-A-RECON-EXTD-VFD
WS-P-DUTY-LINE-RATE1 = WS-P-DUTY-LINE-RATE
WS-A-DUTY-LINE-TOT-PD1 = WS-A-DUTY-LINE-TOT-PD
WS-A-LINE-MDSE-PRCF1 = WS-A-LINE-MDSE-PRCF
WS-I-LINE1 = WS-I-LINE
WS-I-SEQ1 = WS-I-SEQ
*
DISPLAY WS-D-MDSE-IMPORT-US ',' +
WS-I-TRAN-CSTM ',' +
WS-I-SUPLR-LOC-REL ',' +
WS-I-PKSLIP-SUPLR ',' +
WS-I-PART-OR-CNTNR ',' +
WS-I-LINE ',' +
WS-I-SEQ ',' +
WS-C-CNTRY-ORGN ',' +
WS-C-SPCL-CALC-DUTY ',' +
WS-C-HARMZD-FULL ',' +
WS-I-RECON-ENTRY-ID ',' +
WS-C-PART-PRC-SRCE ',' +
WS-A-PART-IMPT-VAL1 ',' +
WS-A-RECON-EXTD-VFD1 ',' +
WS-O-RETR-TOT-AMT ',' +
WS-N-RETR-TOT-AMT ',' +
WS-DIFF-RET-AMT ',' +
WS-P-DUTY-LINE-RATE1 ',' +
WS-A-DUTY-LINE-TOT-PD1 ',' +
WS-A-LINE-MDSE-PRCF1

END-PROC

FINISH-PARA. PROC
STOP EXECUTE
END-PROC

START-PARA. PROC
DISPLAY 'IMPORT DATE' ',' +
'ENTRY NUMBER' ',' +
'SUPPLIER' ',' +
'PKSLIP' ',' +
'PART' ',' +
'LINE #' ',' +
'SEQ #' ',' +
'COO' ',' +
'SPI IND' ',' +
'HTS CODE' ',' +
'RECON ENTRY #' ',' +
'PRC SRC' ',' +
'ENT AMOUNT' ',' +
'RECON AMOUNT' ',' +
'OLD RETRO AMT' ',' +
'NEW RETRO AMT' ',' +
'DIFFERANCE AMT' ',' +
'DUTY RATE' ',' +
'DUTY' ',' +
'MPF'
END-PROC
**
//

Hope it will helpful.
Back to top
View user's profile Send private message
Hames

New User


Joined: 03 Oct 2005
Posts: 49

PostPosted: Wed Nov 23, 2005 1:35 pm    Post subject:
Reply with quote

Hi Ekta,

Thank you for your Quick response.

Its a lengthy program. Anyhow I will go thru it If I had any doubt I will raise it.

One more thing if you find any interesting material for Easytrieve, let me know.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us