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

Extract dataset name and write it into output file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


Joined: 26 Apr 2004
Posts: 4651
Location: Raleigh, NC, USA

PostPosted: Wed Feb 29, 2012 4:40 pm
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
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

Global Moderator


Joined: 26 Apr 2004
Posts: 4651
Location: Raleigh, NC, USA

PostPosted: Wed Feb 29, 2012 5:15 pm
Reply with quote

Search the COBOL forum. I found this one:

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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Wed Feb 29, 2012 6:09 pm
Reply with quote

to find a dsname given a ddnam the simplest approach is to use BPXWDYN
the documentation about is available starting from
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: 2455
Location: Hampshire, UK

PostPosted: Thu Mar 01, 2012 12:11 am
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 02, 2012 1:07 pm
Reply with quote

If you are new to Cobol, you might want to try Use [URL] BBCode for External Links 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: 1691
Location: Tiruppur, India

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

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 02, 2012 2:34 pm
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: 1691
Location: Tiruppur, India

PostPosted: Fri Mar 02, 2012 3:18 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Jes2 command output All Other Mainframe Topics 4
No new posts Selecting the max value from a file. DFSORT/ICETOOL 3
No new posts Change history of vsam file. JCL & VSAM 3
No new posts Repeat a DD line- comment and insert ... CA Products 3
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

Back to Top