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 

To pass parameters from jcl to a Easytrieve program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
chandu
Beginner


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Sun Apr 18, 2004 11:23 pm    Post subject: To pass parameters from jcl to a Easytrieve program Reply with quote

Hi,

I wanted to pass parameters to a easytrieve program through the JCL, just the way we do PARM in cobol , I am not even sure if this is possible.
It would be very helpful if i could get some ideas on this.

Thanks a lot,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Apr 19, 2004 5:31 am    Post subject: Reply with quote

Chandu,

What exactly do you want to pass? Please let us know the exact requirement and may be we can suggest an alternate solution.

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


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Mon Apr 19, 2004 10:48 pm    Post subject: Reply with quote

Hi Kolusu,

Sorry for not posting the entire details ,
I wanted to pass dates in the parm , The dates would be the starting date of the month and the other date would be end date,
like start date could be 20040501 and end date could be 20040730, The processing would be dependent on the date range.
Firstly i wanted to know if passing Parm is an option in Easytrieve,
The only other option i have is to take a file and in that pass data.

Thanks a lot,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 20, 2004 5:03 am    Post subject: Reply with quote

Chandu,

Unfortunately eztrieve does not let you pass parms. But you can pass them via file and read the file just once and move them to a working storage variable and use them for validation.

Code:


FILE DATEFILE
     START-DATE    01 08 A
     END-DATE      09 08 A

WS-START-DATE W 10 A
WS-END-DATE   W 10 A


JOB INPUT KEY (........) START GETDATE


GETDATE. PROC

   GET DATEFILE
   WS-START-DATE   = START-DATE   
   WS-END-DATE     =  END-DATE

END-PROC 


In the above code the START proc will get execueted just once before the actual processing takes place.

Hope this helps...

Cheers

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


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Tue Apr 20, 2004 10:57 pm    Post subject: Reply with quote

Thanks a lot Kolusu,
I have used it the way you demonstarted and it works great.


Regards,
Chandu
Back to top
View user's profile Send private message
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Wed Apr 21, 2004 1:37 am    Post subject: Reply with quote

Chandu,

Eztrieve does allow for processing of a parameter coded on the execute statement. See the utility program EZTPX01, the following is a brief description from the manual.

Utility Programs
EZTPX01
EZTPX01 is a called subprogram used to interrogate a PARM coded on a JCL
EXEC statement. It is distributed with CA-Easytrieve Plus.
EZTPX01 requires two parameters, the system defined PARM-REGISTER, and a
user defined input/output field. The input/output field must consist of a 2-byte
binary field immediately followed by a character portion to contain the actual
PARM information.
You are responsible for placing the maximum length you expect for the PARM
information (the character portion) into the 2-byte binary field before calling
EZTPX01. EZTPX01 moves your PARM data from your JCL EXEC statement into
the character portion of your input/output field and updates the length in the 2-
byte binary portion.

If the PARM data is larger than the maximum length you specified, it is truncated
on the right and the maximum length you defined is retained. If the PARM data
is shorter than the length you specified, the length is updated to reflect the actual
length of the PARM data. See the “Processing JCL Parameters” chapter in the
CA-Easytrieve Plus Application Guide for a sample program using EZTPX01.

==>> I have used this and it works quite nicely. but I still prefer Cobol...
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Apr 21, 2004 8:40 am    Post subject: Reply with quote

Chandu,

I am sorry for telling that easytrieve does not have the option of passing parms. I haven't used them till date.

Chuck thanks for the valuable piece of information. upon looking at it is quite similar to the START procedure I used.

I will try to run the example shown in the application programming guide.

Thanks

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


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Thu Apr 22, 2004 2:04 am    Post subject: Reply with quote

Thanks Kolusu
Thanks Chuck

I tried the example given in the Application program guide and it works pretty nicely even for PARM's greater than 10 bytes
This thing was an eye opener for me regarding utility programs.

Thanks a lot,

Regards,
Chandu
Back to top
View user's profile Send private message
Venkata Ramana Reddy
Beginner


Joined: 02 Dec 2002
Posts: 70
Topics: 19
Location: California

PostPosted: Thu May 27, 2004 7:10 pm    Post subject: Reply with quote

Chandu,
Here is how can pass parameters is Easytrieve Program. I know it is too late but still in case if you need in future.

1) Create a Member EZTPARM with following code
Code:

PARM LINK(EZTPARM R)                                   
  DEFINE PARAM-INFO    W              24  A         
  DEFINE PARAM-LTH     PARAM-INFO     02  B         
  DEFINE PARAM-DATA    PARAM-INFO +2  22  A         
*                                                   
*----------------------------------------------------
 JOB INPUT NULL START(INIT-PARA)                     
*----------------------------------------------------
 INIT-PARA. PROC                                     
*   Accept the Parameters                           
   CALL EZTPX01 USING(PARM-REGISTER PARAM-INFO)     
   IF PARAM-LTH < 1                                 
      DISPLAY 'No Parameters Passed'                 
   ELSE                                             
     DISPLAY 'Parameters Passed  : '  PARAM-DATA     
   END-IF 
   STOP EXECUTE
*--------       
 END-PROC       
*--------       

2) Compile & Link Edit & Run the Program by passing the parameters
Code:

//*--------------------------------------------------------------------
//* Step To Compile Eastrieve Program
//*--------------------------------------------------------------------
//COMPILE  EXEC PGM=EZTPA00                                           
//EZTVFM   DD UNIT=SYSDA,SPACE=(CYL,(25,25))                           
//SYSPRINT DD SYSOUT=*                                                 
//SYSABEND DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSLIN   DD DSN=&&SYSLIN,                                           
//            UNIT=SYSDA,SPACE=(CYL,(20,20),RLSE),DISP=(,PASS)         
//SYSIN    DD DSN=YOUR.EZTSRC.PDS(EZTPARM),DISP=SHR                           
//*--------------------------------------------------------------------
//* Step To Link Edit the above Program
//*--------------------------------------------------------------------
//LINKED  EXEC PGM=IEWL                             
//SYSPRINT  DD SYSOUT=*                             
//SYSLMOD  DD DSN=YOUR.LOADMOD.PDS,DISP=SHR     
//SYSUT1   DD UNIT=SYSDA,SPACE=(CYL,(1,5))         
//SYSLIN   DD DSN=&&SYSLIN,DISP=SHR
//*--------------------------------------------------------------------
//* Step To Run the Easytrieve Program(By passing parameters)
//*--------------------------------------------------------------------
//EZTRUN   EXEC PGM=EZTPARM,PARM='MVSFORUMS'                                 
//STEPLIB  DD DSN=YOUR.LOADMOD.PDS,DISP=SHR                       
//SYSPRINT DD SYSOUT=*                                                 
//SYSABEND DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 


You should see the following in SYSPRINT

Parameters Passed : MVSFORUMS
_________________
Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Back to top
View user's profile Send private message
chandu
Beginner


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Fri May 28, 2004 9:21 am    Post subject: Reply with quote

Thanks a lot Ramana,

An Illustration always helps.


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


Joined: 02 Aug 2005
Posts: 75
Topics: 27

PostPosted: Fri Sep 25, 2009 10:42 am    Post subject: Reply with quote

Thanks to all..

I just used the information which are provided in this topic and able to pass the parameters successfully ..



Thanks
_________________
Regards,
batu
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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