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
 
Automation Error in REXX program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Fri Apr 03, 2009 7:27 pm    Post subject: Automation Error in REXX program
Reply with quote

Hi
I have to automated one of my system and i am calling a subroutine through my code and that subroutine runs for 31 times. My concern is that i have to press enter 31 times to get the final message and the option of "do you want to continue?". As i am doing automation the pressing of enter button is not feisibe because it requires presence of anyone.

Following is the code for your reference

Code:
/* REXX */
OPTION = Y
DO WHILE OPTION='Y'
CLRSCRN
SAY '***WELCOME TO CMDS AUTOMATED SYSTEM***'
SAY 'ENTER 5 DIGIT CYCLE DATE(YYDDD)'
PULL YYDDD
PARSE VAR YYDDD YEAR 3 DAY
IF DAY > 0 & DAY < 366 THEN
DO
    "ALLOC DA('TOLLNA.T.N2100.N2100081.C"YYDDD"01') F(INPUT) SHR REUSE"
    'EXECIO * DISKR INPUT (STEM LINES. OPEN'
      COUNT = LINES.0 ; I = 0 ; J=0
       DO UNTIL I > COUNT
         REC=LINES.I
         PARSE VAR REC ONE TWO THR FRT FIV SIX SEV EIG NIN TEN GAR
          IF FIV='INVALID' THEN
          DO
          PARSE VAR TWO A 5 B 7 C 13 D 15 E 20 F 23 G 26 H
  LINES.I= "  "A"     "C"     "F"     "G"      "D"       "TEN
          QUEUE LINES.I
          J=J+1
          END
        I=I+1
       END
NV.1=" PACKID  PACKDATE  SENDRAO  BILLRAO  INVOICE  EXPECTED-INVOICE"
   "ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
   "EXECIO 1 DISKW MYOUTDD (STEM NV."
   "EXECIO * DISKW MYOUTDD (FINIS"
   'EXECIO * DISKR INPUT (FINIS'
   IF J = 0 THEN
   SAY "NO PACKS ARE REJECTED"
   ELSE
   DO
   SAY J "PACKS ARE REJECTED"
   NDAY = DAY - 1
   NDAY ="0"NDAY
    "ALLOC DA('TOLLNA.T.TEST.REPORT') F(INPUT) SHR REUSE"
    'EXECIO * DISKR INPUT (STEM LINES1. OPEN'
    LOOP = LINES1.0 ; K = 2
    DO UNTIL K > LOOP
    REC1 = LINES1.K
    PARSE VAR REC1 PACK DAT SRAO BRAO INV EINV GAR
    CALL RECEXT
    K=K+1
    END
  /*SUBMIT 'PM863D.CMDS.AUTO(EMAILFIL)'"*/
     SAY "REPORT HAS GENERATED @ PDS TOLLNA.T.TEST.REPORT"
     SAY "A COPY OF THE REPORT HAS BEEN E-MAILED"
   END
END
ELSE
SAY 'INVALID CYCLE DATE,PLEASE ENTER JULIAN CYCLE DATE'
SAY 'DO YOU WANT TO CONTINUE(Y/N)'
PULL OPTION
END
EXIT





RECEXT:
Code:
    DATASET ="TOLLNA.T.G861000.G8610A11.WCOGET.C"YEAR""NDAY"01"
    "ALLOC FI(INPUT1) DA('"DATASET"') SHR REUSE"
    "EXECIO * DISKR INPUT1 (STEM LINES. OPEN"
      COUNT = LINES.0 ; I = 0 ; START=0 ; STOP=0
       DO UNTIL I > COUNT
         REC=LINES.I
         PARSE VAR REC A 13 INVT 15 GAR 20 RAO1 23 RAO2 26
         IF INVT = INV  & RAO1 = SRAO & RAO2 = BRAO THEN
         DO
             IF START = 0 THEN
             DO
                START = I
             END
             ELSE
             DO
                STOP = I
             END
         END
         I=I+1
       END
DO UNTIL STOP < START
QUEUE LINES.START
START = START + 1
END
DATASET1="TOLLNA.T.SRAO"SRAO".BRAO"BRAO".C"YEAR""DAY"01"
"ALLOC DA('"DATASET1"') F(MYOUTDD) LIKE('"DATASET"') NEW REUSE"
"EXECIO * DISKW MYOUTDD (FINIS"
"EXECIO 0 DISKR INPUT1 (FINIS"
RETURN


Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10294
Location: italy

PostPosted: Fri Apr 03, 2009 7:38 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

Code:
'EXECIO * DISKR INPUT (STEM LINES. OPEN'
COUNT = LINES.0 ; I = 0 ; J=0
DO UNTIL I > COUNT
REC=LINES.I


the sequence is a bit poor

use
Code:
 'EXECIO * DISKR INPUT (STEM LINES. FINIS'


why not use a simpler
Code:
DO I = 1 TO COUNT


the way You coded it' s treating LINES.0 as a data line,
but LINES.0 contains the number of records read
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Fri Apr 03, 2009 7:59 pm    Post subject:
Reply with quote

Still it is not working... icon_sad.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Apr 03, 2009 8:12 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

Here's one problem:

NV.1=" PACKID PACKDATE SENDRAO BILLRAO INVOICE EXPECTED-INVOICE"
"ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
"EXECIO 1 DISKW MYOUTDD (STEM NV."
"EXECIO * DISKW MYOUTDD (FINIS"
'EXECIO * DISKR INPUT (FINIS'

You set the stem variable NV.1 to the string shown. Then you use EXECIO to write 1 record from the NV. stem. Then you use EXECIO again with an asterisk (*) specifying an unknown quantity of records, and DISKW to write. Write what? EXECIO is attempting to write everything that's in the data stack. I don't see where anything has "PUSH"ed or "QUEUE"'d to the stack, so EXECIO is expecting you to enter the data from the terminal.

I'd suggest that you get rid of this line of code alltogether.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Apr 03, 2009 8:16 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

I'd recode this:

NV.1=" PACKID PACKDATE SENDRAO BILLRAO INVOICE EXPECTED-INVOICE"
"ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
"EXECIO 1 DISKW MYOUTDD (STEM NV."
"EXECIO * DISKW MYOUTDD (FINIS"
'EXECIO * DISKR INPUT (FINIS'
IF J = 0 THEN
SAY "NO PACKS ARE REJECTED"
...

to this:

PUSH " PACKID PACKDATE SENDRAO BILLRAO INVOICE EXPECTED-INVOICE"
"ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
"EXECIO 1 DISKW MYOUTDD (FINIS"
IF J = 0 THEN
SAY "NO PACKS ARE REJECTED"
...
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Mon Apr 06, 2009 12:21 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

I have recoded the code like
PUSH " PACKID PACKDATE SENDRAO BILLRAO INVOICE EXPECTED-INVOICE"
"ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
"EXECIO 1 DISKW MYOUTDD (FINIS"
IF J = 0 THEN
SAY "NO PACKS ARE REJECTED"

Due to this only one record is been written in the 'TOLLNA.T.TEST.REPORT' file . .. instead i have recoded it like

PUSH " PACKID PACKDATE SENDRAO BILLRAO INVOICE EXPECTED-INVOICE"
"ALLOC DA('TOLLNA.T.TEST.REPORT') F(MYOUTDD) SHR REUSE"
'EXECIO 'j' DISKW MYOUTDD (FINIS'
IF J = 0 THEN
SAY "NO PACKS ARE REJECTED"

Still it is not working .... icon_sad.gif
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2069
Location: Silicon Valley

PostPosted: Mon Apr 06, 2009 9:36 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

I do not see where you followed Enrico's advice. Can you post your most recent program?

Quote:
Still it is not working ....

Not very clear diagnostic information.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2069
Location: Silicon Valley

PostPosted: Mon Apr 06, 2009 9:38 pm    Post subject: Reply to: Automation Error in REXX program
Reply with quote

Code:
SAY '***WELCOME TO CMDS AUTOMATED SYSTEM***'
SAY 'ENTER 5 DIGIT CYCLE DATE(YYDDD)'
PULL YYDDD


If this is for automation, why are you displaying welcome text and expecting input?
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Tue Apr 07, 2009 12:03 pm    Post subject:
Reply with quote

I am automating the process which is coded in the logic. Still it needs basic input like cycle date to initialte the process in test region, once i am done with the coding i can move this in production region and make it a dataset triggered and code according to it.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am


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