Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Strange problem in my REXX script

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

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Mon Jul 17, 2006 10:51 am    Post subject: Strange problem in my REXX script
Reply with quote

Hi Friends;
I have written following REXX script:

/*******************************REXX**********************************/
/* REXX TO GET ALL MEMBER NAME OF PDS */
SAY "ENTER THE SOURCE PDS"
PULL DATASET
SAY "ENTER THE DS TO WRITE OUTPUT"
PULL OUTPUTDS
A = OUTTRAP('VAR.')
"LISTDS "DATASET" MEMBERS"
B = OUTTRAP('OFF')
C = 7

"ALLOC DA("OUTPUTDS") F(OUTFILE) OLD REUSE"
DO Z = C TO VAR.0
MEM = STRIP(VAR.Z)
SAY MEM
"EXECIO 1 DISKW OUTFILE (STEM "MEM""
END

This scripts simply reads the name of the members from PDS and write those to a dataset. This is working fine but having a small problem in it.
It is appending 1 with the member name.

For ex. if there are members XYZ and ABC in the source PDS but it is writting XYZ1 and ABC1 in target DS. I tried to display it before writting, at this point of time it is correct but in dataset output is wrong.

Please suggest me if there is any mistake with script or process..

Thanks
Nitin
Back to top
View user's profile Send private message

Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Mon Jul 17, 2006 12:06 pm    Post subject: Hi
Reply with quote

Try using


" LISTDS " "'" || WORD(DATASET,1) || "' MEMBERS "

in the above script.

-Han.
Back to top
View user's profile Send private message
nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Mon Jul 17, 2006 12:38 pm    Post subject: Re: Strange problem in my REXX script
Reply with quote

Hi;
Thanks for the quick help... but unfortunately I am getting the same result icon_sad.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Jul 17, 2006 1:25 pm    Post subject:
Reply with quote

Why do you use the keyword STEM ?

Here's what happen if you use STEM without a period after the variable name:
Quote:
When var-name does not end with a period, the variable names must be appended with consecutive numbers, such as MYVAR1, MYVAR2, MYVAR3.


This is, of course, from the fine manual.

O.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Mon Jul 17, 2006 6:37 pm    Post subject:
Reply with quote

Try using:

Code:

"EXECIO 1 DISKW OUTFILE (STEM "MEM"||."
Back to top
View user's profile Send private message
parsesource

New User


Joined: 06 Feb 2006
Posts: 97

PostPosted: Thu Jul 20, 2006 4:00 am    Post subject:
Reply with quote

Code:

...
ADDRESS TSO "NEWSTACK"

DO i=7 to VAR.0
 QUEUE(VAR.i)
END;

"EXECIO "QUEUED()" DISKW some other parms i have forgotten...."
Back to top
View user's profile Send private message
nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Fri Jul 21, 2006 1:25 pm    Post subject: Thanks
Reply with quote

Thanks parsesource,

Ur solution worked well and solved my problem
Thanks once again.
Back to top
View user's profile Send private message
nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Fri Jul 21, 2006 5:12 pm    Post subject: Need help in the same script but different problem
Reply with quote

Hi Friends;

In above script;
I tried to call a function as follows:

MAKEJCL = CREATEJCL(MEMNAME,DSNAME,JCLPATH)

and the function is defined as:

CREATEJCL:
ARG MEM,DS,JP
LINE.1 = "//REXXJCL JOB (REXX,TEST),'REXX-TEST',MSGCLASS=9,"
LINE.2 = "// CLASS=B,NOTIFY=REXXUSER"
LINE.3 = "//STEP010 EXEC PGM=IEBGENER"
.
.
.
LINE.8 = "// "

"ALLOC DA("JP") F(JPOUT) OLD REUSE"

NEWSTACK
DO I = 1 TO 8
QUEUE LINE.I
END

"EXECIO * DISKW JPOUT(FINIS "
"FREE FI(JPOUT)"
DELSTACK
SAY "JCL CREATED FOR " MEM
RETURN 0
END

In this I am facing a very small problem but could not find the solution.
The script is working fine but after writing to JPOUT file it doesn't process further until I press enter key.
Means, to see the message "JCL CREATED FOR" I need to press the enter key then only it goes to process another element..
I tried a lot but can't understand the reason behind this.

Please help.....
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Jul 21, 2006 8:31 pm    Post subject: Re: Strange problem in my REXX script
Reply with quote

This is something to try.

Did you do a CALL to a paragraph?
CALL CREATEJCL

If not, you may not need a RETURN 0

A RETURN is used to end a CALL to a paragraph so the REXX can return the the REXX instruction following the CALL to continue processing.
Back to top
View user's profile Send private message
rexxhead

New User


Joined: 15 Nov 2005
Posts: 3
Location: Florida SunCoast

PostPosted: Mon Jul 24, 2006 10:23 pm    Post subject:
Reply with quote

I guess I'll have to say it again...

Code:
"EXECIO * DISKW JPOUT(FINIS "


NEVER write "EXECIO * DISKW ....". Nevernevernevernevernever! There's no need for it. You always have enough information available to be able to specify exactly how many lines to write:

Code:

"EXECIO" queued() "DISKW  JPOUT (FINIS"


The system will not demand a useless ENTER if you do this, but that's not why you should do it.
Back to top
View user's profile Send private message
nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Tue Aug 01, 2006 4:40 pm    Post subject:
Reply with quote

Thanks rexxhead;
Can you throw some light on.. why system was expecting a useless enter and what is the reason that it resolved with the queued() clause..

Thanks
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
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Strange Code amitc23 COBOL Programming 6 Tue Nov 28, 2017 11:25 am
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us