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 DD name get file name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Using DD name get file name
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Sep 22, 2009 4:37 pm    Post subject: Reply to: Using DD name get file name
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    Post subject: Using DD name get file name
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Sep 22, 2009 8:50 pm    Post subject: Reply to: Using DD name get file name
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 23, 2009 7:22 pm    Post subject: Reply to: Using DD name get file name
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Wed Sep 23, 2009 8:12 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 23, 2009 8:27 pm    Post subject: Reply to: Using DD name get file name
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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