View previous topic :: View next topic
|
Author |
Message |
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
can you share a code snippet on this? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
Also suggest me, at the end of the session the temporary file must be deleted. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I think the term "temporary file" means it will be deleted at the end of the task.
O. |
|
Back to top |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Yes, it is possible. Have you read the fine manual?
O. |
|
Back to top |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Why do you need the second ALLOC???
O. |
|
Back to top |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
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... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Just curious: Why do you do it with CLIST and not REXX?
O. |
|
Back to top |
|
|
bhashyam Currently Banned New User
Joined: 13 Nov 2007 Posts: 12 Location: Bangalore
|
|
|
|
YA. But the current, requirement is, i have to do it in CLIST. Please help me. |
|
Back to top |
|
|
|