View previous topic :: View next topic
|
Author |
Message |
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi All,
I am new to Eazytrieve programming and i am trying to pass the values DYNAMICALLY from JCL to Eazytrieve via PARMS.
I have used EZTPX01 routine to do the needful, Version used in my shop: EASYTRIEVE PLUS 11.5-C.
the following is the snipet i have coded:
Code: |
//STEP002 EXEC PGM=EZTPA00,PARM='0001234567'
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=SAMPLE.INFILE,DISP=SHR'
//OUTFILE DD DSN=SAMPLE.OUTFILE,
// DISP=(,CATLG,CATLG),
// SPACE=(CYL,(10,10),RLSE),
// RECFM=VB,LRECL=2133
//EZTVFM DD UNIT=SYSDA,SPACE=(CYL,(100,100))
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//PRINTOUT DD SYSOUT=*
//SYSIN DD *
PARMDATA W 12 A
PARAMLTH PARMDATA 2 B
PARAMDATA PARMDATA +2 10 A
CALL EZTPX01 USING(PARM-REGISTER PARMDATA)
FILE INFILE VB(2133 27998)
I-REC 1 2133 A
I-REC-ID 1 1 N 0
I-CMPY-NO 3 10 A
I-ACCT-NO 3 16 A
I-SEQ-NO 14 5 N 0
I-REC-TYPE 29 2 A
FILE OUTFILE VB(2133 10910)
O-REC 1 2129 A
*
WRITE-REC-FOUND W 1 A VALUE 'N'
*
JOB INPUT INFILE
*
****** CHANGE "...-CMPY-NO" ************************************
IF I-REC-ID = 6
IF I-CMPY-NO = PARAMDATA
WRITE-REC-FOUND = 'Y'
END-IF
END-IF
*
****** CHANGE NEXT LINE ************************************
IF (I-REC-ID = 6 AND +
I-CMPY-NO ¬= PARAMDATA )
WRITE-REC-FOUND = 'N'
END-IF
*
IF WRITE-REC-FOUND = 'Y'
O-REC = I-REC
RECORD-LENGTH(OUTFILE) = RECORD-LENGTH(INFILE)
PUT OUTFILE
END-IF
|
while compiling the above Code i am getting the below error
Quote: |
PROGRAMS AND ALL SUPPORTING MATERIALS COPYRIGHT (C) 1982, 2010 BY CA, INC.
1 PARMDATA W 12 A
1 *******B014 UNABLE TO RECOGNIZE STATEMENT |
and
Quote: |
*******B059 PREMATURE END OF FILE
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)
|
I am trying to analyze the error but i am not able to identify the error, Kinldy help me to find what was the mistake i made in the above code and Thanks a lot for the time and help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
CALL has to be part of an "activity".
Try
Code: |
JOB +
INPUT INFILE +
START procedure-before-we-really-get-going +
NAME some-nice-name-for-the-job
procedure-before-we-really-get-going. PROC
CALL EZTPX01 USING(PARM-REGISTER PARMDATA)
END-PROC
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Ramsee,
If there is something that you don't understand about an answer, you reply to it with your query, not send a PM.
You define data (generally) in the "library". Files and two types of (working) storage.
You cannot use procedural code in the "library".
Your procedural code has to be in an "activity" (with a JOB or a SORT).
You only want to do the CALL once. Easytrieve Plus provides a way to invoke a PROCedure before the first record is prsented (START on the JOB statement) or at the end of processing (FINISH on the JOB statement).
You want a "START procedure" which should include your CALL.
If still unclear, ask again in this topic. |
|
Back to top |
|
|
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi Bill,
I am using the EZT code in my SYSIN card and i was not able to succeed in Passing the value via PARM Dynamically.
Instead i have created a DYNAMIC File (parameter subjected to change based on the INPUT) and used this FILE as an additional input to the EZT pgm and i am able to succeed in this approach.
DYNAMIC File will be deleted at the start of the JOB and will be created before the EZT step with the required DYNAMIC values.
I tried my best by using PROC but not able to succeed.
Thanks a lot for your time in educating me. |
|
Back to top |
|
|
|