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

ISPF Length error while running REXX EXECIO


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Wed Jul 17, 2013 6:38 pm
Reply with quote

Hi

We are trying to check if the file is empty or not using REXX and if the file is empty we are appending 'E' to file name and write the entire string in a PS.

The below piece of code is not working for all the files. Some of the files it is able to write with an appended 'E' but as soon as the file with a bigger name encountered it errored with ISPF error ISPV006. Screenshot attached.
As far as I know we dont variable length limits in REXX ( Atleast we dont have to define them). Although the output file names are not that lengthy too. Please help on this.

We have Another confusion here that whenever EXECIO is used in loop it automatically appends 1 to the stem variable ( Hence you can see the workaround in the code for it icon_smile.gif). Does it work this way ??
Code:

    DO I = 1 TO 20                                         
         ADDRESS ISPEXEC                                       
           "LMDLIST LISTID("VAR1") OPTION(LIST) DATASET(DSVAR1)"
           IF RC = 0 THEN                                       
             DO                                                 
                                               
               DSNNAME = DSVAR1                                 
               ADDRESS TSO                                     
               "ALLOC DA('"DSNNAME"') F(TESTF) SHR REUSE"       
               "EXECIO 1 DISKR TESTF (FINIS STEM DSTEST"       
                 IF RC \= 0 THEN                               
                    DO                                         
                      DSVAR1 = DSNNAME || ' E'                 
                    END                                         
               "FREE F(TESTF)"                                 
                                             
               ADDRESS ISPEXEC                                 
               ADDRESS ISPEXEC                                       
               "DSINFO DATASET('"DSNNAME"')"                         
               IF RUNDATE = ZDSCDATE | RUNDAT2 = ZDSCDATE THEN       
               DO                                                                       
                 ADDRESS TSO                                         
                 "ALLOC DA('"OUTFILE"') F(OUTFL) MOD"     
/* Tried TRACE and Code is abending with ISPV006 here */           
                 "EXECIO 1 DISKW OUTFL (FINIS STEM DSVAR"           
                 "FREE F(OUTFL)"                                     
               END                                                   
             END                                                     
         END                                                         
          ADDRESS ISPEXEC                                           
           "LMDLIST LISTID("VAR1")   OPTION(FREE)"                   
                                                     
                     



ISPV006 is the error I am getting. Please help
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Wed Jul 17, 2013 7:11 pm
Reply with quote

ISPV006 Data truncation occurred - Data for aaaaaaaa format variable
"bbbbbbbb" was too long.

Explanation: The variable value being updated is longer than the length
specified on the VDEFINE for the variable in question.

User response: Contact the responsible programmer.


I have kept the RECLENGTH of the output file as 80. It should be good enough !!!
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Wed Jul 17, 2013 7:12 pm
Reply with quote

And this is all REXX Code. So Lengths shouldn't be aproblem here ?? Please correct me if i am wrong.
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Wed Jul 17, 2013 7:19 pm
Reply with quote

Also, the name of the next file which code should be about to list is of 40 characters.

I have tried increasing the RECLENGTH of output file to 2500 from 80. It is still giving the same abend.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Jul 17, 2013 7:53 pm
Reply with quote

Note that in your EXECIO statements you are not specifying a stem, but a partial name. You have
Code:
"EXECIO 1 DISKR TESTF (FINIS STEM DSTEST"

which indeed causes EXECIO to concatenate a number to DSTEST. If instead you wrote
Code:
"EXECIO 1 DISKR TESTF (FINIS STEM DSTEST."

it would be a true stem (note the period) and your input record would in variable DSTEST.1.

Please post the trace for the iteration of the outermost loop in which the abend occurs. It is possible that appending the "E" causes either the DSN or the LLQ to be of an invalid length.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 17, 2013 7:54 pm
Reply with quote

Where is the LMDINIT statement ?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Jul 17, 2013 9:58 pm
Reply with quote

I've been trying to figure out why the error message is from ISPF and not from REXX. I think that mixing the ISPF variable DSVAR1 with a REXX stem variable of the same name is the culprit.
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Thu Jul 18, 2013 11:41 am
Reply with quote

Akatsukami: Thanks for the clarification of STEM EXECIO appending 1. New learning for me today. The requirement is such that we cant write an array so used it this way.

EXPAT : I have written LMDINIT Statement too in the code but not mentioned in the screenshot.

Superk : Bingo !!!! You nailed the issue. I introduced another variable and it worked. Can never thank you enough !!!

Code snippet is below :

Code:


ADDRESS ISPEXEC
     "LMDLIST LISTID("VAR1") OPTION(LIST) DATASET(DSVAR1)"
   IF RC = 0 THEN
     DO
         DSNNAME = DSVAR1
         FINDSN1 = DSVAR1
         ADDRESS TSO
         "ALLOC DA('"DSNNAME"') F(TESTF) SHR REUSE"
         "EXECIO 1 DISKR TESTF (FINIS STEM DSTEST"
           IF RC \= 0 THEN
              DO
                FINDSN1 = DSNNAME || ' E'
              END
         "FREE F(TESTF)"
        DO
         ADDRESS TSO
         "ALLOC DA('"OUTFILE"') F(OUTFL) MOD"
         "EXECIO 1 DISKW OUTFL (FINIS STEM FINDSN"
         "FREE F(OUTFL)"
       END
     END

Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 18, 2013 4:34 pm
Reply with quote

Why are you opening and closing the output file every time you want to write a record? And why not store all the data to be written in a stem and write at the end?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Jul 18, 2013 4:41 pm
Reply with quote

Nic Clouston wrote:
Why are you opening and closing the output file every time you want to write a record? And why not store all the data to be written in a stem and write at the end?


sshakya2 wrote:
The requirement is such that we cant write an array so used it this way.


Very few software engineers have either the knowledge or the seniority to question "requirements", however foolish.
Back to top
View user's profile Send private message
sshakya2

New User


Joined: 23 Dec 2010
Posts: 17
Location: Mumbai, India

PostPosted: Thu Jul 18, 2013 4:59 pm
Reply with quote

Nic .. The file which I am writing is being written from multiple places with different data streams one by one.

Akatsukami : Thanks for your "Non Required" comments too.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
Search our Forums:

Back to Top