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
 

 

Error is passing values from JCL to Easytrieve program

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

New User


Joined: 06 Jan 2011
Posts: 52
Location: Chennai

PostPosted: Mon Oct 14, 2013 8:21 pm    Post subject: Error is passing values from JCL to Easytrieve program
Reply with quote

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Mon Oct 14, 2013 8:43 pm    Post subject: Reply to: Error is passing values from JCL to Easytrieve pro
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Mon Oct 14, 2013 9:08 pm    Post subject: Reply to: Error is passing values from JCL to Easytrieve pro
Reply with quote

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

New User


Joined: 06 Jan 2011
Posts: 52
Location: Chennai

PostPosted: Fri Oct 18, 2013 7:37 pm    Post subject: Reply to: Error is passing values from JCL to Easytrieve pro
Reply with quote

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
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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