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

using temporary files


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Thu Nov 22, 2007 11:17 am
Reply with quote

Hi,
I want to create a temporary file using CLIST and want to dump some records in it. I want to map this temporary file with a logical name and want to use it in a cobol program. Please tell me how this can be implemented in CLIST and share me soma sample code for this.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 12:06 pm
Reply with quote

It has nothing to do with CLIST. Use the TSO command ALLOCATE to allocate a dataset with DEL in the second disposition.

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Thu Nov 22, 2007 1:36 pm
Reply with quote

can you share a code snippet on this?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 1:48 pm
Reply with quote

No, I can't "share a code", but you are more then welcome to read the fine manual (which also contains some good examples).

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Thu Nov 22, 2007 2:05 pm
Reply with quote

Also suggest me, at the end of the session the temporary file must be deleted.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Nov 22, 2007 2:12 pm
Reply with quote

here is a skel for the job..

Code:

//jobname  JOB ......
//*4567890123456
//STEP1   EXEC PGM=your_create_prog
//ddname    DD DISP=(NEW,PASS),DSN=&&anyname,
//             SPACE=....
//             DCB=......
//.... other dd statements as needed     
//*
//STEP2   EXEC PGM=your_using_prog
//ddname    DD DISP=(OLD,DELETE),DSN=&&anyname
//.... other dd statements as needed     
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 2:13 pm
Reply with quote

I think the term "temporary file" means it will be deleted at the end of the task.

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Thu Nov 22, 2007 2:33 pm
Reply with quote

YES.
I want to create a temporary file in the CLIST, map it with a logical name and call a COBOL program. The Cobol program will access this file for some ISPF purpose. Atlast when the Cobol program is executed, obviously it will come back to the CLIST. When the CList ends I want to delete this temporary file.

I want to avoid using JCL in this. Is it possible to do something with ALLOC commmands. please suggest me.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 2:35 pm
Reply with quote

Yes, it is possible. Have you read the fine manual?

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Fri Nov 23, 2007 8:42 am
Reply with quote

Yes I read.
But I couldnt implement it accurately.

Assume that my temoporary file name is TEMP.
I want creat it, Alocate it top file INFILE. And delete TEMP after some time.

How can i do it?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Nov 23, 2007 8:48 am
Reply with quote

If it's truly a temporary file, then it won't have a name.

Try something like this:

ALLOC FI(INFILE) NEW REU UNIT(VIO) SPACE(n,n) CYLINDERS
RECFM(FB) LRECL(xxx)

Then, when you're done with the processing, free the file:

FREE FI(INFILE)
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Fri Nov 23, 2007 11:42 am
Reply with quote

Code:

FREE  ATTR(@DECK)
ATTR  @DECK RECFM(FB) LRECL(80) BLKSIZE(7440)-
DSORG(PS)
FREE FI(INFILE)
FREE  DD(FT50F001)
ALLOC FI(INFILE) NEW REU UNIT(SYSWK) SPACE(5,5) TRACKS-
USING(@DECK)
ALLOC DD(FT50F001) FI(INFILE)
OPENFILE FT50F001 INPUT


When i gave the above statement, it is printing following error

OPENFILE FT50F001 INPUT
IKJ56545I THIS STATEMENT HAS FAILED TO OPEN THE REQUESTED FILE


How can i resolve it?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Nov 23, 2007 12:01 pm
Reply with quote

Why do you need the second ALLOC???

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Fri Nov 23, 2007 1:19 pm
Reply with quote

Code:

FREE  ATTR(@DECK)
ATTR  @DECK RECFM(FB) LRECL(80) BLKSIZE(7440)-
DSORG(PS)
FREE FI(INFILE)
ALLOC FI(INFILE) NEW REU UNIT(SYSWK) SPACE(5,5) TRACKS-
USING(@DECK)
OPENFILE INFILE INPUT


even this is throwing the same error... icon_cry.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Nov 23, 2007 2:59 pm
Reply with quote

Just curious: Why do you do it with CLIST and not REXX?

O.
Back to top
View user's profile Send private message
bhashyam
Currently Banned

New User


Joined: 13 Nov 2007
Posts: 12
Location: Bangalore

PostPosted: Fri Nov 23, 2007 10:39 pm
Reply with quote

YA. But the current, requirement is, i have to do it in CLIST. Please help me.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top