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
 

 

using temporary files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: using temporary files
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: 2360
Location: Israel

PostPosted: Thu Nov 22, 2007 12:06 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Nov 22, 2007 1:48 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Nov 22, 2007 2:12 pm    Post subject: Reply to: using temporary files
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: 2360
Location: Israel

PostPosted: Thu Nov 22, 2007 2:13 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Nov 22, 2007 2:35 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Nov 23, 2007 8:48 am    Post subject: Reply to: using temporary files
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    Post subject:
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: 2360
Location: Israel

PostPosted: Fri Nov 23, 2007 12:01 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Fri Nov 23, 2007 2:59 pm    Post subject:
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    Post subject:
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    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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


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