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
 

 

Need Help In Coding Rexx code
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Thu Jun 03, 2010 12:00 pm    Post subject: Need Help In Coding Rexx code
Reply with quote

I have to compare 3 files. For that our design says to create a panel and send the file names to jcl and invoke the jcl from there itself.
I never worked on REXX till date. Please help me giving some sample code.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 03, 2010 1:04 pm    Post subject:
Reply with quote

Well, the first problem is your management giving you a task for which you are not prepared for. However, there is a lot of REXX code on the forum for you to look at. Also the manuals are all available from the manuals sticky at the top of the CLIST / REXX forum.

There will be far more involvement that just plain old REXX here, as almost certainly you will also need to invoke some of the ISPF services.

Which program / utility do you envisage to perform the file compares.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Thu Jun 03, 2010 1:13 pm    Post subject:
Reply with quote

The panel will look like below.
CDL PAL Verification

1 Extract 6000 / CDL 2300
2 Extract 6000 / PAL 3700
3 Extract 6000 / CDL 2300 / PAL 3700

Please enter your option [_1_]
Compare Invoice Y/N [_Y_]
Environment DEVL SYSI QA PROD [_D_]

Extract file:[____________________________________________________]

PAL file: [____________________________________________________]

CDL file: [____________________________________________________]

Invoice file:[____________________________________________________]


PF3 = EXIT, PF6= Process

when PF6 is processed it should pass the parm value (combination of option, compare invoice and environment to jcl) and jcl should get submitted. The jcl looks like below.
//P54xxxx JOB (CMP01),'P54G73',
// CLASS=1,MSGCLASS=X,NOTIFY=&SYSUID RESTART=PS15
//JOBLIB DD DSN=TSHRPD.PAL.LOADLIB,DISP=SHR
//*************************************************************
//PS01 EXEC PGM=ITPCMP2,parm=’xx’
//CDL DD DSN=xxxxxxxxxxxxxxxxxxx,
// DISP=SHR,DCB=BUFNO=30
//PAL DD DSN=xxxxxxxxxxxxxxxxxxx,
// DISP=SHR,DCB=BUFNO=30
//BILEXT DD DSN=xxxxxxxxxxxxxxxxxxx,
// DISP=SHR,DCB=BUFNO=30
//INVOICE DD DSN=xxxxxxxxxxxxxxxxxxx,
// DISP=SHR,DCB=BUFNO=30

//SYSTSPRT DD SYSOUT=*
//SYSOUT DD DSN=dummy
//SYSPRINT DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//

what i require is is hw to code the same in REXX
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Thu Jun 03, 2010 4:40 pm    Post subject:
Reply with quote

Quote:
I never worked on REXX till date. Please help me giving some sample code.
This is a HELP forum, not a WRITE-YOUR-CODE-FOR-YOU forum. The responders are paid for their professional work product, which is what you are asking for. Unless you are willing to pay for the code (and 1000 U.S. dollars and up per day is common), please do not ask for code. There are plenty of code examples posted on the forum but they were donated.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Thu Jun 03, 2010 4:45 pm    Post subject:
Reply with quote

Thanks for not helping... Bye
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jun 03, 2010 5:03 pm    Post subject: Reply to: Need Help In Coding Rexx code
Reply with quote

Quote:
Thanks for not helping... Bye


sarcasm will get You nowhere,
and certainly will not get You any help
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Thu Jun 03, 2010 5:11 pm    Post subject:
Reply with quote

Oh okay ,,, Thanks ,, bye
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 5:27 pm    Post subject:
Reply with quote

you ever notice how these children who say
'you have not helped me!!!!'
'I am going away and never coming back'


But they always stick around
and whine like a baby
when any comment is made about their childish behavior.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jun 03, 2010 5:57 pm    Post subject: Reply to: Need Help In Coding Rexx code
Reply with quote

the whole ISPF shebang
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM61

the whole REXX shebang
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK80

the ISPF PRIMER ... old but still useful
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISRVPB01/CONTENTS?SHELF=&DT=19931028105440
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Jun 03, 2010 6:23 pm    Post subject:
Reply with quote

Just in case you're sticking around...

You will need a small rexx program that will:
- display the panel,
- terminate if PF3 was hit,
- validate the data,
- merge the data into a JCL (that's called File Tailoring),
- submit the job

Show me that you have made an effort:
- look for panel definition examples,
- draw your own panel,
- write a small rexx that display the panel,
- show us the results,
then you will get more help.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 11:35 am    Post subject:
Reply with quote

PANEL:-

)ATTR
$ TYPE(TEXT) SKIP(ON) intens(low) color(yellow)
# TYPE(TEXT) SKIP(ON) color(blue)
_ CAPS(ON) PAD('_')
¬ CAPS(OFF) PAD('_')
! TYPE(INPUT) CAPS(OFF) JUST(LEFT) PAD(NULLS) INTENS(LOW)
¢ TYPE(OUTPUT) CAPS(OFF) JUST(LEFT) PAD(' ')
)BODY WINDOW(74,18) EXPAND(\\)
$ CDL PAL VERIFICATION
$ -------------------------
%
# [1] EXTRACT 6000 / CDL 2300
# [2] EXTRACT 6000 / PAL 3700
# [3] EXTRACT 6000 / CDL 2300 / PAL 3700
%
% Please Enter Your Option : !A1$
% Compare With Invoice File Y/N : !B1$
% Environment DEV(D)SYSI(S)/QAHQQ)/PRODHPP): !C1$
% Extract File:!input1 $
% HPP ALAL File :!input2 $
% CDADLAL File :!input3 $
% Invoice File:!input4 $
$Message --->!SkyMsg $<
%
%
% <F6>+Send Page %<F3>+Do NOT Send
)INIT
.cursor = 'a1'
)PROC
&PFKEY = .PFKEY
emsgg = ' '
)END

CODE:-
/* rexx */
trace on
/* +++++++++++ TESTING ++++++++++++++ */
panellibb = tshrpddHPp5czz6.rexx.panel'
clistlibb = tshrpddHPp5czz6.rexx.clist'
trace on
address ISPEXEC
"control errors return"
sysenv =sysvarr(sysenvv')
sysuid =sysvarr('sysuid')
address TSO ALTLIBB ACTIVATE APPLICATION(EXEC) DSN('clistlibb"')"
if recc ¬= 0) then do
say ALTLIBB ACT failed,recc=recc
exit 99
end
"LIBDEF ISPPLIBDATASETT ID('panellibb"')"
ispskell =tshrpdpHP.p54gz6.proclib'
"LIBDEF ISPSLIB DATASET ID('"ispskel"')"
/* ------------------------------------------------------------ */
address ISPEXEC
emsg = ''
"DISPLAY PANEL(TEST1V)"
ADDRESS ISPEXEC "VGET (ZPFKEY) ASIS"
ZPF06_SAVE = ZPF06
ZPF06 = DoprefixExecute
"VPUT (ZPF06) PROFILE"
SELECT
WHEN ZPFKEY = 'PF03' THEN
say "byeeeeeeeeeeeee"
WHEN (ZPFKEY = 'PF06' | ZPFKEY = 'ENTER') THEN
SETMSG "SkuMsg(Hi....)"
OTHERWISE
EXIT
END

Thanks enrico-sorichetti. The links shared helping me a lot. Now I am facing problem in implementing the keys. I am using PF03 key to exit from the screen(is working fine) and PF06 as process key but when i press PF06 its giving msg on the right top saying "RCHANGE is allowed"
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jun 15, 2010 11:48 am    Post subject: Reply to: Need Help In Coding Rexx code
Reply with quote

why bother with pfkeys...
use ENTER to proceed PF3 to exit
that' the general suggested way of doing it
( never had the need to use anything else )

You might also setup a further panel to ask for confirmation
( ENTER PF3 as usual ) that could be disabled per user preference
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 15, 2010 11:51 am    Post subject:
Reply with quote

Why this obsession with using PF keys to signal OK. What is wrong with good old "ENTER"
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 12:08 pm    Post subject:
Reply with quote

Ok I try implement the same. Is it required to code PFKEYS validations in program or it going to happen automatically.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jun 15, 2010 12:14 pm    Post subject: Reply to: Need Help In Coding Rexx code
Reply with quote

Quote:
Is it required to code PFKEYS validations in program or it going to happen automatically.

You do not have to do any validation... You just need to check the return codes after a panel display

RC=8 User requested termination via the END or RETURN command
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 12:50 pm    Post subject:
Reply with quote

How to validate the enterered option on the screen in rexx code?

is the below way is correct:

option = a1 /* taking the value from screen variable */
if (option \= 1) or (option \= 2) or (option \= 3) then
do
skumsg = 'invalid option entered'
end

is this works?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 15, 2010 12:53 pm    Post subject:
Reply with quote

No. Think about exactly what your logic is doing. Try to follow it through using Option = 2 as an example.
Back to top
View user's profile Send private message
Srinivasarangam
Warnings : 1

New User


Joined: 01 Jun 2010
Posts: 39
Location: India

PostPosted: Tue Jun 15, 2010 1:00 pm    Post subject:
Reply with quote

Used ENTER key in the panel.

Panel:
% Please Enter Your Option : !A1$

Code:
Code:
ADDRESS ISPEXEC "VGET (ZPFKEY) ASES"                     
IF REC \= 0 THEN                                         
DO                                                       
  SAY "TERMINATED ABNORMALLY"                           
END                                                     
IFPFKEYY = PFUIF03' THEN                                   
  SAY "GOOD BYE.."                                       
  EXIT                                                   
OPTION = A1                                             
IF (OPTION \= 01) | (OPTION \= 02) | (OPTION \= 03) THEN
   SAY "INVALID OPTION ENTERED"                         
ELSE                                                     
KNOP NOP                                                   
EXIT             


I am expecting and validating the option field as above in my code. When option 07 is given and press <ENTER> key, witout giving any message the control is coming out from the REXX screen. Please let me know where am doing wrong
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 15, 2010 1:22 pm    Post subject:
Reply with quote

As you appear to have done some reading and made your own efforts, here is some code that I use
Code:
DO FOREVER
  "ISPEXEC DISPLAY PANEL(AAAAMAIN)"
 
  IF RC = 8 | ZCMD = 'x' | ZCMD = 'X'
     THEN EXIT

  ERRMSG1 = " "
  ERRMSG2 = " "
  ERRMSG3 = " "

  RTYP = ZCMD
  ZCMD = ' '

  IF RTYP = 'a' | RTYP = 'A' THEN DO
     CALL AAAA_DSN                           
     INDSNAME = " "                           
  END                                         
  ELSE IF RTYP = 'b' | RTYP = 'B' THEN DO     
     PANID = "AAAATAB1"                                         
     ROWSEL = 0                                                 
     ROWOUT = 0                                                 
     CALL AAAA_PAN                                               
  END                                                           
  ELSE IF RTYP = 'c' | RTYP = 'C' THEN DO                       
     PANID = "AAAATAB2"                                         
     ROWSEL = 0                                                 
     ROWOUT = 0                                                 
     CALL AAAA_REP                                               
  END                                                           
  ELSE DO                                                       
     ERRMSG1 = "INVALID SELECTION - "RTYP" - PLEASE RESPECIFY"   
     RTYP = " "                                                 
     RESULT = 4                                                 
  END                                                           
                                   
  IF RESULT <> 0 THEN ITERATE       

  The rest of the code follows here

END
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Tue Jun 15, 2010 1:30 pm    Post subject: Reply to: Need Help In Coding Rexx code
Reply with quote

Code:
% PLEASE ENTER YOUR OPTION : !A1$     
% COMPARE WITH INVOICE FILE Y/N : !B1$

When you have to define an input field of one character you can use the Z placeholder:
Code:
% PLEASE ENTER YOUR OPTION : !Z$     
% COMPARE WITH INVOICE FILE Y/N : !Z$
...
)INIT             
 .ZVARS = '(OPTION INVOICE)'
ISPF will replace each Z in the )BODY section by the corresponding name in the .ZVARS (1st Z get 1st name, 2nd Z gets 2nd name and so on).
Of course, this happens only if the Z char is in an input or output field.

You can validate most on the fields in the )PROC section. Try this:
Code:
)PROC
  VER(&OPTION,NB,LIST,1,2,3)
  VER(&INVOICE,NB,LIST,Y,N)
  VER(&INPUT1,NB,DSNAME)

As you will see, you do not need to define a field for messages.
Let ISPF handle this for you, it will be easier.
Later, you will learn how to create messages of your own.

Check all statements in the book
You can do more interesting validations:
Code:
  IF (&INVOICE = Y)
     VER(&INPUT4,NB,DSNAME)
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 -> TSO/ISPF All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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