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
 

 

Extract dataset name and write it into output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
onesaggi

New User


Joined: 22 Dec 2010
Posts: 5
Location: Mumbai

PostPosted: Wed Feb 29, 2012 4:32 pm    Post subject: Extract dataset name and write it into output file
Reply with quote

Hi!

Is anybody aware of how to extract dataset name and write it into output file without using REXX.

I have requirement as mentioned below:

INDD DD DSN=T.EXTRACT.UPDATE,DISP=SHR

OUTDD DD DSN=T.BACKUP,DISP=(MOD,CATLG,CATLG)

Now, I want to write T.EXTRACT.UPDATE in T.BACKUP output dataset.

Thus, my output dataset will look like
12345 XYZ T.EXTRACT.UPDATE

Can this be done without using REXX.
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: Wed Feb 29, 2012 4:40 pm    Post subject: Reply to: Extract dataset name and write it into output file
Reply with quote

How about using SAS? COBOL?
Back to top
View user's profile Send private message
onesaggi

New User


Joined: 22 Dec 2010
Posts: 5
Location: Mumbai

PostPosted: Wed Feb 29, 2012 5:02 pm    Post subject:
Reply with quote

COBOL will be great! could you please show me the code to accept file name from JCL?
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: Wed Feb 29, 2012 5:15 pm    Post subject: Reply to: Extract dataset name and write it into output file
Reply with quote

Search the COBOL forum. I found this one:

http://ibmmainframes.com/viewtopic.php?t=6604

as an example.
Back to top
View user's profile Send private message
onesaggi

New User


Joined: 22 Dec 2010
Posts: 5
Location: Mumbai

PostPosted: Wed Feb 29, 2012 6:04 pm    Post subject:
Reply with quote

Thanks a lot Superk!!

I am using IKJEFTSR and IKJTSOEV programs to avail DD name. Where can I find these programs in libraries? My compiler is unable to find them.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Feb 29, 2012 6:09 pm    Post subject: Reply to: Extract dataset name and write it into output file
Reply with quote

to find a dsname given a ddnam the simplest approach is to use BPXWDYN
the documentation about is available starting from
http://www-03.ibm.com/systems/z/os/zos/bkserv/index.html

examples are available searching the cobol forum
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Thu Mar 01, 2012 12:11 am    Post subject:
Reply with quote

Why not have your input datasetname as a symbolic e.g.
Code:
//DDNAME DD DSN=&INDSN,DISP=SHR/OLD

and have your program accept a parameter which is the same as that for your DSN e.g.
Code:
//STEP EXEC PGM=MYPGM,
//          PARM= &INDSN
Back to top
View user's profile Send private message
onesaggi

New User


Joined: 22 Dec 2010
Posts: 5
Location: Mumbai

PostPosted: Fri Mar 02, 2012 1:03 pm    Post subject:
Reply with quote

Thanks Nic.

I am trying with your option. I want to write the DSN name of INDSN into output file by MYPGM. I am new to cobol. could you please guide me the way to extract file name from the address of INDSN?

Thanks in advance!
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Mar 02, 2012 1:07 pm    Post subject: Reply to: Extract dataset name and write it into output file
Reply with quote

If you are new to Cobol, you might want to try www.ibmmainframeforum.com which is for Beginners and Students.

If you want to go Nick's route, search this forum for examples of passing the PARM to a Cobol program.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Mar 02, 2012 2:31 pm    Post subject:
Reply with quote

I think Bill meant http://www.ibmmainframeforum.com/
yup, corrected
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Mar 02, 2012 2:34 pm    Post subject: Reply to: Extract dataset name and write it into output file
Reply with quote

I think that you are certainly right Vasanthz. Thanks.

Proving once again the value of the Preview button, and clicking on the link. I wonder if it would have come back to the "recursive" topic?

EDIT: In an all-round masterful display of brain-skills, I notice I also got Nic's name wrong. Sorry Nic.

Further EDIT: And Vasanthz's. Fixing now. Sorry Vasanthz. Spelling "round" correctly as well. Looks like it is going to be a good day :-)
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Mar 02, 2012 3:18 pm    Post subject:
Reply with quote

Its ok to be intoxicated at work on Friday :-)
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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