View previous topic :: View next topic
|
Author |
Message |
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi Friends,
I have to retrieve the name of the file allocated in the region using the DD name.
I tried using DFHCSD VSAM file and it found so tricky to get the file name.
Is there any other simple way to get the file name using DD name using Batch? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In the CICS System Programming Reference for your version/release, review the INQUIRE FILE API.
Note that the translator option SP must be specified in your translation step, which some shops don't allow.
Check with management first.
Bill |
|
Back to top |
|
|
dramadasa
New User
Joined: 16 Sep 2009 Posts: 1 Location: India
|
|
|
|
If you know the file name, hope you can specifiy directly with DD Name. |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi Bill,
I have to use it in a JCL. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In the step prior to running the program step, execute a REXX EXEC, using the LISTDSI function and the FILENAME keyword, which will return (amongst other info), the DSN.
Move the DSN returned from REXX to a temporary dataset and either pass it to the program in the next step as a parm or in the temporary dataset which the program reads.
Bill |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi Bill,
Im pleased to use the REXX, but if i give LISTDSI function:
where do i get Filename?
Which region will REXX access?
I have DD name and i have to get File name from the region for the corresponding DD name..... |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If you code the following DD (just an example) to be used with the REXX EXEC -
Code: |
//FILEDD DD DSN=MY.FILEDD.DATASET,DISP=SHR
|
And pass the DD name to the REXX EXEC as an argument, the DSN will be returned from the EXEC.
Bill |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Bill, I have DD name and I have to get file name...... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I can see a problem with file names changing everyday - idiots still use date in the file name.
how often do you change file names in CICS?
what does your batch process do? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If REXX will not work for you, then another method would be to write an EXCI program, passing the DD name in the commarea to the target CICS region, allowing for a 44-byte DSN to be returned in the commarea, as well as a 20-byte RETCODE area.
Note that the file needs to be OPEN and ENABLED (you can issue a SET command as soon as the CICS program gains control) and once you obtain the DSN and move it to the commarea, you must issue a CLOSE, using either UNENABLED or DISABLED, which is also a SET command.
Also, the target region needs to be up and active.
Review the EXCI interface in your applicable "CICS External Interfaces Guide", associated with your particular verson/release.
IIRC, EXCI was first introduced with CICS/ESA 4.1.
Bill |
|
Back to top |
|
|
dominickim
New User
Joined: 28 Feb 2007 Posts: 65 Location: NS, CA
|
|
|
|
Hello Manigandan,
Have you used IKJEFTSR program before? TSO command LISTALC with STATUS gives you all DD names with associated file names.
Code: |
MOVE 'LISTALC STATUS' TO WS-BUFFER.
CALL 'IKJEFTSR' USING WS-FLAGS
WS-BUFFER
WS-LENGTH
WS-RETURN-CODE
WS-REASON-CODE
WS-DUMMY.
IF WS-RETURN-CODE = ZERO
DISPLAY 'COMMAND EXECUTED. SEE OUTPUT DD SYSTSPRT'
ELSE
DISPLAY 'IKJEFTSR FAILED, RETURN-CODE=' WS-RETURN-CODE.
STOP RUN.
|
Output dataset from DD name SYSTSPRT
Code: |
COMMAND EXECUTED. SEE OUTPUT DD SYSTSPRT
--DDNAME---DISP--
CEE.SCEELKED
SYSLIB KEEP
USERID.JOBNAME.JOB#.D0000103.?
SYSOUT DELETE
USERID.JOBNAME.JOB#.D0000104.?
SYSTSPRT DELETE
NULLFILE SYSTSIN
|
|
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Quote: |
Is there any other simple way to get the file name using DD name using Batch? |
Yes...
(1) Acquire some software like BatchCICS (www.batchcics.com)
(2) Write your own EXCI interface like Bill suggests, only I would
use the EXEC CICS INQUIRE FILE (DDNAME) "SPI" command
in the related CICS program.
(3) Contract me to write something for you and I'll ship you the code. |
|
Back to top |
|
|
|