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
 

 

Multiple Datasets not getting created in RunTime

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

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Oct 29, 2009 7:44 pm    Post subject: Multiple Datasets not getting created in RunTime
Reply with quote

Hi,

This is my rexx program.
Code:

/**** REXX **************************************/ 
 "ALLOC DA('myid.PLAN.COLL') F(INPUT) SHR REUSE"
 "EXECIO * DISKR INPUT (STEM LINES. FINIS"         
                                                   
 DO I=1 TO LINES.0                                 
    PARSE VAR LINES.I PLANNAME COLLECTION         
                                                   
    CALL COLLQUERY PLANNAME, COLLECTION           

 END                                               

COLLQUERY: PROCEDURE           
                               
PLANNAME   = STRIP(ARG(1))     
COLLECTION = STRIP(ARG(2))     
.
.
.
.
ADDRESS TSO
FN = 'myid.'                                                       
FN = FN || PLANNAME || '.' || COLLECTION                             
SAY 'DATASET NAME : ' FN                                             
"ALLOC FI(OUTREC) DA('"FN"') MOD DELETE REUSE",                     
"CYL SPACE(10,10) LRECL(200) RECFM(F,B,A) DSORG(PS)"                 
"EXECIO *  DISKW OUTREC (STEM RECORD. FINIS"                         
RETURN

Contents of the FILE : myid.PLAN.COLL
Code:
AAIPPLAN                  AAI1
AAIPPLAN                  CLIC
AAIPPLAN                  INEO



My Goal is , the program should read the input file.

Send the two fields to the sub-routine.

It does some processing.

After each processing a file with following naming convention should be created
Code:
myid.AAIPPLAN.AAI1
myid.AAIPPLAN.CLIC
myid.AAIPPLAN.INEO


But, what is happening is only the last dataset is being created myid.AAIPPLAN.INEO.
So, for testing purposes i edited the input file and removed myid.AAIPPLAN.INEO. So, if i run again the rexx program,
myid.AAIPPLAN.CLIC dataset should be created. But, what happened is myid.AAIPPLAN.INEO got replaced by myid.AAIPPLAN.CLIC.




Thank You,
Sushanth
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 29, 2009 7:47 pm    Post subject:
Reply with quote

Run using TRACE ?I to see what happens when, and that should help find the error
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Oct 29, 2009 8:03 pm    Post subject:
Reply with quote

Sushanth,

Try with this.

Code:
"ALLOC FI(OUTREC) DA('"FN"') MOD REUSE",                     
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Oct 29, 2009 8:18 pm    Post subject:
Reply with quote

Thank You Very Much SriHari, it works.

Can i know what seems to be the problem ?

Sushanth
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 29, 2009 8:21 pm    Post subject:
Reply with quote

Yes, by specifying DELETE the dataset gets deleted when the dataset is closed and released
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Oct 29, 2009 8:26 pm    Post subject:
Reply with quote

expat,

Before making these changes, why last dataset did not get deleted.

Sushanth
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Thu Oct 29, 2009 8:29 pm    Post subject: Reply to: Multiple Datasets not getting created in RunTime
Reply with quote

I don't know about anyone else, but I don't see a FREE command anywhere in your code...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 29, 2009 8:29 pm    Post subject:
Reply with quote

Mmmmmmmmmmmmmmmmmmm, interesting point.

I can only think that the last dataset was not freed up by the REUSE because being the last dataset the REUSE would not be executed again.

Something to look into when I get a lazy afternoon icon_lol.gif
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Oct 29, 2009 8:54 pm    Post subject:
Reply with quote

SuperK,

Code:
"FREE F(OUTREC)"


I added the above statement.

Thank You,
Sushanth
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 29, 2009 8:58 pm    Post subject:
Reply with quote

doesn't REUSE inplies FREE when a new allocation is made to the same DD
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Oct 29, 2009 9:20 pm    Post subject: Reply to: Multiple Datasets not getting created in RunTime
Reply with quote

A few side remarks:

Quote:
"ALLOC FI(OUTREC) DA('"FN"') MOD REUSE",
"CYL SPACE(10,10) LRECL(200) RECFM(F,B,A) DSORG(PS)"

10 Cylinders? Do you really need that? (If not, add the RELEASE option or use TRACKS)
In RECFM, "A" indicates the record contains ASCII printer control characters. Do you really need that? (If not, just remove)

Quote:
END

COLLQUERY: PROCEDURE

What, no EXIT after the end? Then COLLQUERY is executed one more time...

Quote:
FN = 'myid.'
FN = FN || PLANNAME || '.' || COLLECTION

Enjoy the power and beauty of REXX:
FN = 'myid.'PLANNAME'.'COLLECTION
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Thu Oct 29, 2009 9:23 pm    Post subject: Reply to: Multiple Datasets not getting created in RunTime
Reply with quote

Just a personal pet peeve, but everyone who uses the TSO ALLOCATE command needs to get into the habit of FREE'ing those allocations when they're no longer needed.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Oct 29, 2009 11:26 pm    Post subject: Reply to: Multiple Datasets not getting created in RunTime
Reply with quote

And rather than 'myid', you should code it for general use:
Code:
SysVar('SysPref')

Will use the user's desired dataset prefix.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Oct 30, 2009 12:59 am    Post subject: Re: Reply to: Multiple Datasets not getting created in RunTi
Reply with quote

Quote:

In RECFM, "A" indicates the record contains ASCII printer control characters. Do you really need that? (If not, just remove)

Correction: the "A" in RECFM does not refer to ASCII characters. It actually indicates that the records contain ISO/ANSI printer control characters ( ISO stands for International Organization for Standards, and ANSI stands for American National Standards Institute ). The "A" USED to stand for ASA ( American Standards Association ), the predecessor to ANSI.
If the file is a print file, and actually contains carriage control characters in the first byte, then the "A" in RECFM is required if you want the printer to honor the carriage control characters. Removing the "A" will result in actually printing the contents of byte-1, probably truncating byte 121 or 133, ( standard record lengths for reports with carriage control ) and single spacing the entire report.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Oct 30, 2009 12:09 pm    Post subject:
Reply with quote

Hello Marso,

1. I have added RELEASE open in ALLOCation.

2. My mistake, there were few more operations after the loop in main prog.

3. Made changes to concatenating variables.


Hi Pedro,

For testing purposes, i am using myid, when its going for real, i will be changing it as per systems naming convention.


Ronald Burr,


i have removed 'A' in RECFM. Since, i don't require printer control characters.


Thank You Marso, Thank You Pedro & Thank You Ronald Burr.
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 DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


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