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

Using DD name get file name


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 22, 2009 4:17 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Sep 22, 2009 4:37 pm
Reply with quote

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
View user's profile Send private message
dramadasa

New User


Joined: 16 Sep 2009
Posts: 1
Location: India

PostPosted: Tue Sep 22, 2009 5:07 pm
Reply with quote

If you know the file name, hope you can specifiy directly with DD Name.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 22, 2009 8:19 pm
Reply with quote

Hi Bill,
I have to use it in a JCL.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Sep 22, 2009 8:50 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Wed Sep 23, 2009 10:37 am
Reply with quote

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..... icon_sad.gif
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 23, 2009 7:22 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Wed Sep 23, 2009 7:35 pm
Reply with quote

Bill, I have DD name and I have to get file name......
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 23, 2009 8:12 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 23, 2009 8:27 pm
Reply with quote

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
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Thu Sep 24, 2009 12:50 am
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Sep 24, 2009 7:54 am
Reply with quote

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
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top