SYSUSED is not working while runnign with JCL
Moderators: Veera, Moderator Group
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
SYSUSED is not working while runnign with JCL
Hello, I am new to forum and REXX as well.
I wrote a code which use LISTDSI function of REXX and from the return of this Function Like SYSUSEDPAGES,SYSPRIMARY,SYSSECONDS,SYSUSED,SYSMEMBERS I am doing some utilization calculations. It working absolutely fine when i am running it implicitly / explicitly and writing the desired output in the file.
but when i am trying to run this with the JCL then any parameter returning me nothing, hence my airthmetic operations getting failed.
Can some one pls help to correct this.
JCL I am running
//ZDELETE1 EXEC PGM=IKJEFT01,COND=(0,NE)
//SYSEXEC DD DSN=MYID.MYREXX,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//OUTFILE DD DISP=OLD,DSN=MY.HOUSEKP.DSNINFO.RPT
//SYSTSIN DD *
%TEST
//INFILE DD DISP=SHR,DSN=MY.HOUSEKP.DSNINFO
/*
REXX I am running
( I have shortern the code of rexx, if this will successfull then my whole code will be fine i believe)
/*REXX*/
INFO = LISTDSI('THIS.IS.MYPDS)
SAY 'SYSUSED IS 'SYSUSED
I wrote a code which use LISTDSI function of REXX and from the return of this Function Like SYSUSEDPAGES,SYSPRIMARY,SYSSECONDS,SYSUSED,SYSMEMBERS I am doing some utilization calculations. It working absolutely fine when i am running it implicitly / explicitly and writing the desired output in the file.
but when i am trying to run this with the JCL then any parameter returning me nothing, hence my airthmetic operations getting failed.
Can some one pls help to correct this.
JCL I am running
//ZDELETE1 EXEC PGM=IKJEFT01,COND=(0,NE)
//SYSEXEC DD DSN=MYID.MYREXX,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//OUTFILE DD DISP=OLD,DSN=MY.HOUSEKP.DSNINFO.RPT
//SYSTSIN DD *
%TEST
//INFILE DD DISP=SHR,DSN=MY.HOUSEKP.DSNINFO
/*
REXX I am running
( I have shortern the code of rexx, if this will successfull then my whole code will be fine i believe)
/*REXX*/
INFO = LISTDSI('THIS.IS.MYPDS)
SAY 'SYSUSED IS 'SYSUSED
Thanks
Rajiv
Rajiv
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
no you are wrong.I have shortern the code of rexx, if this will successfull then my whole code will be fine i believe
first of all,
i imagine that you have no code to check the return from any functions or services
Code: Select all
IF RC <> 0 THEN
DO
SAY 'RETURN FROM ... NOT 0'
EXIT
END
more than likely, you are requesting a service
that requires some libraries
and you don't have any.....
but you have decided that you are sooooo clever,
you do not need to show us your REXX Script.
great, i don't want to look at it anyway,
do a search on 'running rexx in batch'
in google.
or read the manual concerning running rexx scripts in batch.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
I don't know, I get the same results either way. I do know that the REXX code you posted is syntactically incorrect, and doesn't look right to begin with. A LISTDSI for a specific dataset is usually coded:
INFO = LISTDSI("'MY.DATASET'")
with the dataset fully qualified with the TSO convention of single quotes, and then surrounded by the double quotes.
or, if the dataset name is a variable,
DSN = MY.DATASET
INFO = LISTDSI("'"DSN"'")
I think the only way it can work as you posted is if TSO PROFILE PREFIX(youruserid) is active.
INFO = LISTDSI("'MY.DATASET'")
with the dataset fully qualified with the TSO convention of single quotes, and then surrounded by the double quotes.
or, if the dataset name is a variable,
DSN = MY.DATASET
INFO = LISTDSI("'"DSN"'")
I think the only way it can work as you posted is if TSO PROFILE PREFIX(youruserid) is active.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
Apology Dick, but my intention was not like to hide the REXX code .. I was trying to make it simple so that it can be understandable.
i am getting the output in SYSOUT
SYSUSED IS
and then nothing, when i am running the same via EX in front of the member then i am getting some real value.
/*REXX*/
X = LISTDSI("PPT11FBN.M02323.HISNDM")
IF X =0
THEN DO
SAY `SYSUSEDPAGES IS`SYSUSEDPAGES
END
EXIT
please help to understand this , how can i get the desired output.
i am getting the output in SYSOUT
SYSUSED IS
and then nothing, when i am running the same via EX in front of the member then i am getting some real value.
/*REXX*/
X = LISTDSI("PPT11FBN.M02323.HISNDM")
IF X =0
THEN DO
SAY `SYSUSEDPAGES IS`SYSUSEDPAGES
END
EXIT
please help to understand this , how can i get the desired output.
Thanks
Rajiv
Rajiv
PPT11FBN.M02323.HISNDM should be enclosed in single quotes, as you would any dataset in TSO, 'PPT11FBN.M02323.HISNDM'
then, the entire string should be surrounded by double quotes to avoid possible translation as a variable,
X = LISTDSI( double-quote single-quote PPT11FBN.M02323.HISNDM single-quote double-quote )
then, the entire string should be surrounded by double quotes to avoid possible translation as a variable,
X = LISTDSI( double-quote single-quote PPT11FBN.M02323.HISNDM single-quote double-quote )
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
Thanks MrSpoc and all for replying, thanks it solved my problem with the one file(PDS/E) name.but when i am trying to run my program in loop using STEM Variablle. its returning me nothing. and hence its getting failed in Airthmetic operation.
can you please help me in that as well.
this is my REXX code
/*REXX*/
UID=SYSVAR(SYSUID)
"DELETE '"||UID||".JCLLIB.UTI'"
"ALLOC DSNAME('"||UID||".JCLLIB.UTI') NEW CAT RECFM(F B) LRECL(133)",
"CYL SPACE(1,1)"
"ALLOC F(INFILE) DA('MY.HOUSEKP.DSNINFO') SHR"
"ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') OLD REUSE"
"NEWSTACK"
"EXECIO * DISKR INFILE (STEM VAR. FINIS"
DO I =1 TO VAR.0
INFO = LISTDSI(VAR.I)
IF SYSUSED = "N/A" THEN
DO
IF SYSUNITS = "CYLINDER" THEN KB = 182
IF SYSUNITS = "TRACK" THEN KB = 12
USED=(SYSUSEDPAGES*100)/((SYSPRIMARY+(SYSSECONDS*123))*KB)
Y = ' PDSE'
END
ELSE
SAY 'THIS IS A PDS'
This is my output, what i am getting
1READY
%TEST
28 +++ USED=((SYSUSED*KB)*100)/((SYSPRIMARY+(SYSSECONDS*15))*KB)
IRX0041I Error running TEST, line 28: Bad arithmetic conversion
IKJ56500I COMMAND FILE NOT FOUND
IKJ56621I INVALID COMMAND NAME SYNTAX
READY
END
can you please help me in that as well.
this is my REXX code
/*REXX*/
UID=SYSVAR(SYSUID)
"DELETE '"||UID||".JCLLIB.UTI'"
"ALLOC DSNAME('"||UID||".JCLLIB.UTI') NEW CAT RECFM(F B) LRECL(133)",
"CYL SPACE(1,1)"
"ALLOC F(INFILE) DA('MY.HOUSEKP.DSNINFO') SHR"
"ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') OLD REUSE"
"NEWSTACK"
"EXECIO * DISKR INFILE (STEM VAR. FINIS"
DO I =1 TO VAR.0
INFO = LISTDSI(VAR.I)
IF SYSUSED = "N/A" THEN
DO
IF SYSUNITS = "CYLINDER" THEN KB = 182
IF SYSUNITS = "TRACK" THEN KB = 12
USED=(SYSUSEDPAGES*100)/((SYSPRIMARY+(SYSSECONDS*123))*KB)
Y = ' PDSE'
END
ELSE
SAY 'THIS IS A PDS'
This is my output, what i am getting
1READY
%TEST
28 +++ USED=((SYSUSED*KB)*100)/((SYSPRIMARY+(SYSSECONDS*15))*KB)
IRX0041I Error running TEST, line 28: Bad arithmetic conversion
IKJ56500I COMMAND FILE NOT FOUND
IKJ56621I INVALID COMMAND NAME SYNTAX
READY
END
Thanks
Rajiv
Rajiv
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
REXX
/*REXX*/
UID=SYSVAR(SYSUID)
"ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
"ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') SHR"
"NEWSTACK"
"EXECIO * DISKR INFILE (STEM VAR. FINIS"
DO I =1 TO VAR.0
INFO = LISTDSI(VAR.I)
/* ANY AIRTHMETIC OPERATION */
SAY 'SYSUSED :'SYSUSED
X = SYSUESD*1
END
ok, here it is
please see Bad arithmetic conversion
1READY
%TEST
3 *-* UID=SYSVAR(SYSUID)
>L> "SYSUID"
>F> "I023230"
4 *-* "ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
>L> "ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
5 *-* "ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') SHR"
>L> "ALLOC F(OUTFILE) DA('"
>V> "I023230"
>O> "ALLOC F(OUTFILE) DA('I023230"
>L> ".JCLLIB.UTI') SHR"
>O> "ALLOC F(OUTFILE) DA('I023230.JCLLIB.UTI') SHR"
IKJ56246I DATA SET I023230.JCLLIB.UTI NOT ALLOCATED, FILE IN USE
+++ RC(12) +++
6 *-* "NEWSTACK"
>L> "NEWSTACK"
7 *-* "EXECIO * DISKR INFILE (STEM VAR. FINIS"
>L> "EXECIO * DISKR INFILE (STEM VAR. FINIS"
8 *-* DO I =1 TO VAR.0
>L> "1"
>V> "91"
9 *-* INFO = LISTDSI(VAR.I)
>C> "VAR.1"
>V> "pca7t011.ADBS.JCLLIB.ARCHIVE
"
>F> "16"
10 *-* /* ANY AIRTHMETIC OPERATION */
11 *-* SAY 'SYSUSED :'SYSUSED
>L> "SYSUSED :"
>V> ""
>O> "SYSUSED :"
SYSUSED :
12 *-* X = SYSUESD*1
>L> "SYSUESD"
>L> "1"
12 +++ X = SYSUESD*1
IRX0041I Error running TEST, line 12: Bad arithmetic conversion
READY
END
/*REXX*/
UID=SYSVAR(SYSUID)
"ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
"ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') SHR"
"NEWSTACK"
"EXECIO * DISKR INFILE (STEM VAR. FINIS"
DO I =1 TO VAR.0
INFO = LISTDSI(VAR.I)
/* ANY AIRTHMETIC OPERATION */
SAY 'SYSUSED :'SYSUSED
X = SYSUESD*1
END
ok, here it is
please see Bad arithmetic conversion
1READY
%TEST
3 *-* UID=SYSVAR(SYSUID)
>L> "SYSUID"
>F> "I023230"
4 *-* "ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
>L> "ALLOC F(INFILE) DA('HIS.HOUSEKP.DSNINFO') SHR"
5 *-* "ALLOC F(OUTFILE) DA('"||UID||".JCLLIB.UTI') SHR"
>L> "ALLOC F(OUTFILE) DA('"
>V> "I023230"
>O> "ALLOC F(OUTFILE) DA('I023230"
>L> ".JCLLIB.UTI') SHR"
>O> "ALLOC F(OUTFILE) DA('I023230.JCLLIB.UTI') SHR"
IKJ56246I DATA SET I023230.JCLLIB.UTI NOT ALLOCATED, FILE IN USE
+++ RC(12) +++
6 *-* "NEWSTACK"
>L> "NEWSTACK"
7 *-* "EXECIO * DISKR INFILE (STEM VAR. FINIS"
>L> "EXECIO * DISKR INFILE (STEM VAR. FINIS"
8 *-* DO I =1 TO VAR.0
>L> "1"
>V> "91"
9 *-* INFO = LISTDSI(VAR.I)
>C> "VAR.1"
>V> "pca7t011.ADBS.JCLLIB.ARCHIVE
"
>F> "16"
10 *-* /* ANY AIRTHMETIC OPERATION */
11 *-* SAY 'SYSUSED :'SYSUSED
>L> "SYSUSED :"
>V> ""
>O> "SYSUSED :"
SYSUSED :
12 *-* X = SYSUESD*1
>L> "SYSUESD"
>L> "1"
12 +++ X = SYSUESD*1
IRX0041I Error running TEST, line 12: Bad arithmetic conversion
READY
END
Thanks
Rajiv
Rajiv
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
you don't have and FREEs,
you never check the RC
how do you expect to debug this thing if you don't internally
(with your code)
check for errors?
also,
if you are running this in batch,
and your jcl for the step is as you provided in your first post,
you don't need to ALLOC your INFILE and OUTFILE.
i would suggest that you remove the DD statements from your JOB.
you never check the RC
how do you expect to debug this thing if you don't internally
(with your code)
check for errors?
also,
if you are running this in batch,
and your jcl for the step is as you provided in your first post,
you don't need to ALLOC your INFILE and OUTFILE.
i would suggest that you remove the DD statements from your JOB.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
Thanks for your help MrSpoc, really appericiate.
seems i am near and getting the below error now
can you please suggest a good book for REXX beginers (hardcopy)
thanks again
1READY
%TEST
IKJ56246I DATA SET HIS.HOUSEKP.DSNINFO.NEW NOT ALLOCATED, FILE IN USE
IKJ56709I INVALID DATA SET NAME, 'BCA07T11.ADBS.JCLLIB.ARCHIVE
IKJ56709I INVALID DATA SET NAME, '
15 +++ Y = SYSUSED + 1
IRX0041I Error running TEST, line 15: Bad arithmetic conversion
READY
END
seems i am near and getting the below error now
can you please suggest a good book for REXX beginers (hardcopy)
thanks again
1READY
%TEST
IKJ56246I DATA SET HIS.HOUSEKP.DSNINFO.NEW NOT ALLOCATED, FILE IN USE
IKJ56709I INVALID DATA SET NAME, 'BCA07T11.ADBS.JCLLIB.ARCHIVE
IKJ56709I INVALID DATA SET NAME, '
15 +++ Y = SYSUSED + 1
IRX0041I Error running TEST, line 15: Bad arithmetic conversion
READY
END
Thanks
Rajiv
Rajiv
-
- Member
- Posts: 13
- Joined: Wed Mar 14, 2012 8:18 pm
some one pls help me on this. bit urgent
1READY
%TEST3
2
IKJ56709I INVALID DATA SET NAME, 'JHA07T11.INTA.JCLLIB
IKJ56709I INVALID DATA SET NAME, '
LIST 16
9 +++ Y = SYSUSED + 1
IRX0041I Error running TEST3, line 9: Bad arithmetic conversion
READY
END
/*REXX*/
"ALLOC F(IN) DA('HIS.HOUSEKP.DSNINFO.NEW') SHR"
"EXECIO * DISKR IN (STEM VAR. FINIS"
"FREE F(IN)"
SAY VAR.0
DO I =1 TO VAR.0
LIST = LISTDSI("'"VAR.I"'")
SAY 'LIST 'LIST
Y = SYSUSED + 1
SAY 'SYSUSED + 1 :'Y
END
EXIT
1READY
%TEST3
2
IKJ56709I INVALID DATA SET NAME, 'JHA07T11.INTA.JCLLIB
IKJ56709I INVALID DATA SET NAME, '
LIST 16
9 +++ Y = SYSUSED + 1
IRX0041I Error running TEST3, line 9: Bad arithmetic conversion
READY
END
/*REXX*/
"ALLOC F(IN) DA('HIS.HOUSEKP.DSNINFO.NEW') SHR"
"EXECIO * DISKR IN (STEM VAR. FINIS"
"FREE F(IN)"
SAY VAR.0
DO I =1 TO VAR.0
LIST = LISTDSI("'"VAR.I"'")
SAY 'LIST 'LIST
Y = SYSUSED + 1
SAY 'SYSUSED + 1 :'Y
END
EXIT
Thanks
Rajiv
Rajiv
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page