IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Passing parameter from JCL to a FOCUS program


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Tue Apr 13, 2010 8:57 am
Reply with quote

Hi,

Can anyone help me out with how to pass data from JCL SYSIN card to a FOCUS program.

Below is the FOCUS pgm,

Code:
TABLE FILE REPORT                 
PRINT AMT AS "PRICE"         
INV AS "INV-NO"             
INVDT AS "INV-DATE"           
BY AREA AS "AREA"         
IF INVDT FROM '100330'         
            TO '100330'           
ON TABLE SAVE AS OUTFILE FORMAT WP
END                               


The date field hard coded here must come from the JCL.
Back to top
View user's profile Send private message
nemo_budd

New User


Joined: 30 Mar 2008
Posts: 7
Location: Pune

PostPosted: Tue Apr 13, 2010 12:31 pm
Reply with quote

You can pass the data from JCL to focus as below.

Code:
 
//SYSIN      DD *
EX FOCUS  INVBEGDT='100330', INVENDDT='100330'



Code:


TABLE FILE REPORT                 
PRINT AMT AS "PRICE"         
INV AS "INV-NO"             
INVDT AS "INV-DATE"           
BY AREA AS "AREA"         
IF INVDT FROM '&INVBEGDT'         
            TO '&INVENDDT'           
ON TABLE SAVE AS OUTFILE FORMAT WP
END   



If the dates are changed on regular basis like monthly or weekly, then you can calculate the date in your focus exec itself using date functions, without passing from JCL.
Back to top
View user's profile Send private message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Tue Apr 13, 2010 1:04 pm
Reply with quote

Your suggestion have worked.
Thanks a lot man...

I also tried the following and it wokred, but yours is a better way.

//STARTDT DD *
//050101
//ENDDT DD *
//100330

And in FOCUS

-READ STARTDT &START.I6.
-READ ENDDT &END.I6.
TABLE FILE REPORT
PRINT AMT AS "PRICE"
INV AS "INV-NO"
INVDT AS "INV-DATE"
BY AREA AS "AREA"
IF INVDT FROM '&START'
TO '&END'
ON TABLE SAVE AS OUTFILE FORMAT WP
END
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
Search our Forums:

Back to Top