Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Problem in displaying the o/p file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 4:26 pm    Post subject: Problem in displaying the o/p file
Reply with quote

Hi ,

Im writting to an output file using a rexx code. Then the file is thrown to the screen (it is displayed).
The code is writing properly to the o/p file but while displaying it is showing the previous version not the recently written one. The particular code is invoked by submitting a JCL from another rexx program.

The o/p file is displayed using
"ISPEXEC EDIT DATASET('TEST.DATA.OUTPUT(TESTOUT)')"

How can I solve this problem?

Thanks.
Back to top
View user's profile Send private message
References
PostPosted: Mon May 19, 2008 4:26 pm    Post subject: Re: Problem in displaying the o/p file Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 4:29 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

Quote:
The code is writing properly to the o/p file but while displaying it is showing the previous version not the recently written one


How do You check that the code is writing properly ???

somewhere along the path there is a flaw...
but the info given is not enough to start debugging
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 5:13 pm    Post subject:
Reply with quote

Actually I am writing the data to o/p file and then displaying it. But the displayed file shows the old data. But when I open the file like the normal way (after exiting from the code) the o/p file contains the current data. The displayed file during the code process contains old data.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 5:22 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

maybe You are browsing the input dataset ???
without seeing the rexx script anything we can say might be wrong

run with a trace and read carefully the output
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 5:36 pm    Post subject: THE CODE
Reply with quote

ADDRESS ISPEXEC
"LIBDEF ISPPLIB DATASET ID ("REXXDSN")"
"DISPLAY PANEL (PANEL)"
ADDRESS TSO
"ALLOC DA('"USER".REXX.SETUP') F(SETDD) SHR REUSE"
"EXECIO * DISKR SETDD (FINIS STEM SETDA."
"FREE F(SETDD)"

CALL MAIN_JCL
"ISPEXEC EDIT DATASET('G65084.TESTDATA.OUTPUT(TESTOUT)')"
EXIT

MAIN_JCL:
ARRAY.1 = ""JOB_CARD""
ARRAY.2 = "//STEP01 EXEC PGM=FILEAID,REGION=6M"
ARRAY.3 = "//STEPLIB DD DISP=SHR,DSN="STEP_LIB""
ARRAY.4 = "//SYSPRINT DD SYSOUT=*"
ARRAY.5 = "//SYSLIST DD DSN="USER".FAID.OUTPUT.LIST,"
ARRAY.6 = "// DISP=(NEW,CATLG,DELETE),"
ARRAY.7 = "// SPACE=(TRK,(5,5),RLSE),"
ARRAY.8 = "// LRECL=80,RECFM=FB"
ARRAY.9 = "//DD01 DD DSN="COPYLIB",DISP=SHR"
ARRAY.10= "//SYSIN DD *"
ARRAY.11= "$$DD01 RLPRINT MEMBER="COPYNAME""
ARRAY.12= "/*"
ARRAY.13= "//STEP02 EXEC PGM=IKJEFT01,DYNAMNBR=20"
ARRAY.14= "//SYSPROC DD DSN="USER"."REXXDSN",DISP=SHR"
ARRAY.15= "//SYSPRINT DD SYSOUT=*"
ARRAY.16= "//SYSTSPRT DD SYSOUT=*"
ARRAY.17= "//SYSTSIN DD *"
ARRAY.18= ""REXXCODE""
ARRAY.19= "/*"
ARRAY.20= "$$"
ARRAY.0 = 20
DO I=1 TO ARRAY.0 BY 1
QUEUE ARRAY.I
END
O = OUTTRAP("OUTPUT.",,"CONCAT")
ADDRESS TSO "SUBMIT * END ($$)"
O = OUTTRAP(OFF)
RETURN

/*GENREX code contains following:*/
/*rexx*/
ADDRESS TSO
"ALLOC DA('G65084.TESTDATA.OUTPUT(TESTOUT)') F (TESTOUT) SHR REUSE"
"ALLOC DA('G65084.FAID.OUTPUT.LIST') F (RECDD) SHR REUSE"
CALL DATA_GET
CALL DATA_PARA
EXIT

DATA_PARA:
ARRAY.1 = ""JOB_CARD""
ARRAY.2 = "//DATSET EXEC PGM=IEBDG"
ARRAY.3 = "//SYSPRINT DD SYSOUT=*"
ARRAY.4 = "//DDOUT DD DSN="OUTDSN" ,"
ARRAY.5 = "// DISP=(NEW,CATLG,DELETE),"
ARRAY.6 = "// SPACE=(CYL,(10,10)),"
ARRAY.7 = "// DCB=(DSORG=PS,RECFM=FB,LRECL="REC_LEN")"
ARRAY.8 = "//SYSIN DD *"
ARRAY.9 = " DSD OUTPUT=(DDOUT)"
IN=10
DO I=1 TO TOT

ARRAY.IN=
" FD NAME=NAME"I",LENGTH="LEN.I",FORMAT=AL,ACTION=RP"
IN=IN + 1
END

ARRAY.0=IN
DO I=1 TO ARRAY.0 BY 1
QUEUE ARRAY.I
END
QUEUE
"EXECIO * DISKW TESTOUT (FINIS"
"FREE F(TESTOUT)"
RETURN
/*since the DATA_GET para is huge. I havnt shown tat here*/
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 6:02 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

there is nothing in Your rexx that updates the dataset You are trying to edit

You are displaying a panel,
You are reading a dataset into a stem variable,
- the stem SETDA. is not being used anywhere
You invoke MAIN_JCL ( which builds and submits a job )
You edit a dataset that has no relation whatsoever with what has been done up to this point

looks like Your dataset will be updated created only during the batch run

also it looks ike You cut and pasted from different sources with different naming conventions

genrex is only in a comment
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 6:15 pm    Post subject:
Reply with quote

Actually the program is huge. so I just pasted only the important ones.
GENREX code is in different member.
The MAIN_JCL submits a job & the o/p file genrated from step01 is used by the rexxcode GENREX. Based on this input file GENREX is generating a JCL that is thrown to the user. The jcl generated by GENREX is written to the file G65084.TESTDATA.OUTPUT(TESTOUT).

once the main rexcode is run(the one invokin panel) the o/p file TESTOUT will be shown.

The o/p file is getting written w.o any fail but while displayin it is showing the old data.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 6:18 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

Looks like You did not understand my reply...

after calling MAIN_JCL You expect to see the result of something
that You will not even know when and if it will be executed

nothing shows that Your dataset id being created between the MAIN_JCL call
and the ISPEXEC EDIT blah... blah...
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 6:53 pm    Post subject:
Reply with quote

The O/P dataset is already created and I have allocated it in SHR mode.It is getting allocated in GENREX code.

Thers nothin bet MAIN_JCL and ISPFEXEC command. Once the jcl in MAIN_JCL is submitted , the GENREX uses the files generated from the JCL submitted to genearte the o/p file. After the GENREX code has written the data to the o/p file control is given back to main rexx code. It then displays the o/p file.

Main rexx code (with panel) -> submits JCL which invokes GENREX -> GENREX get data from i/p file (submited jcl wil produce tat) processes and writes to o/p file TESTOUT -> Main rexx code displays the o/p file.

will the instructions after MAIN_JCL starts executing even b4 completion of JCL submitted from the same code?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 6:55 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

Yes, what else did You expect icon_cool.gif
submit just submits and that' s all

as I said before batch is an asyncronous process and nobody will know how and when the submitted job will be scheduled/perocessed/executed

if You had lurked the forums You would have seen that the issue has been debated to death
and that is not possible, within reasonable terms, to sync a tso session with a batch execution with

if the batch process is simple why not run everything within Your rexx...
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 13
Location: Mysore

PostPosted: Mon May 19, 2008 6:59 pm    Post subject:
Reply with quote

Oh then I need to wait for the RC from the JCL submitted and then display the file rite?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 965
Location: Virginia, USA

PostPosted: Mon May 19, 2008 7:01 pm    Post subject:
Reply with quote

rexx77 wrote:
Oh then I need to wait for the RC from the JCL submitted and then display the file rite?


What if there are no initiators available and the batch job doesn't run for several hours?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2560
Location: italy

PostPosted: Mon May 19, 2008 7:02 pm    Post subject: Reply to: Problem in displaying the o/p file
Reply with quote

the replies just crossed themselves over
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7505
Location: 221 B Baker St

PostPosted: Mon May 19, 2008 7:57 pm    Post subject:
Reply with quote

Hello,

Quote:
Oh then I need to wait for the RC from the JCL submitted and then display the file rite?
Probably not. . . You need to re-read this topic, understand what others have mentioned, and then look around in the forum and see that this is not a good approach.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1