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
 

 

Need to copy data from PS file to JCL

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

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Fri Dec 18, 2009 2:19 pm    Post subject: Need to copy data from PS file to JCL
Reply with quote

Hi all,
In a raquirement. I need to copy data from PS file to a JCL.

The complete scenario is as below,

In Step 1 , I am having GDG base and searching for some specific text in the versions of that GDG, and required version name i will be getting in PS file.
Now i need to use that version name in step 2. I repeat I need to have version name which is inside the PS file in jcl step DD.

How i can do this. Please help me in this regard.

Thanks in advance.

Regards,
Kapil.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 18, 2009 2:27 pm    Post subject:
Reply with quote

The version will almost certainly always be 00.

/RANT ON
When talking about GDS it is important to use the correct terminology, as both version and generation are both valid in terms of a GDS.

It is a well known fact that only one version of a GDS may exist at any one time, however, multiple generations may exist together.

Please learn and use the correct terminology when posting, as using the wrong term can cause confusion and possibly delay a resolution to your problem
/RANT OFF

How do you plan to allocate the rquired GENERATION of the GDS once you have found out which it is, because once the JCL has been interpreted by JES it is set in stone.
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Fri Dec 18, 2009 2:46 pm    Post subject:
Reply with quote

Hi expat and all,
I apologise for my mistake. and correcting my requirement.

The complete scenario is as below,

In Step 1 , I am having GDG base and searching for some specific text in the generations of that GDG, and required generations name i will be getting in PS file.
Now i need to use that generation name in step 2. I repeat I need to have generation name which is inside the PS file in jcl step DD.

How i can do this. Please help me in this regard.

Thanks in advance.

Regards,
Kapil.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Dec 18, 2009 2:55 pm    Post subject:
Reply with quote

OK, so which program / utility will you use to find out which generation has the desired data held within.

And having established which generation(s) contain this data, how do you propose to allocate them to the program that will process them.

This type of question has been asked quite a few times already, and some of the suggestions are to ............
1) Use INTRDR to submit a second job built by the first
2) Build an include member and submit a second job
3) Use of the scheduler package with option (2) above instead of INTRDR
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri Dec 18, 2009 4:12 pm    Post subject:
Reply with quote

Quote:
In Step 1 , I am having GDG base and searching for some specific text in the generations of that GDG, and required generations name i will be getting in PS file.
Now i need to use that generation name in step 2. I repeat I need to have generation name which is inside the PS file in jcl step DD.

How i can do this. Please help me in this regard.
This absolutely, categorically cannot be done. Period. Because once the job is submitted, and JES goes through the converter / interpreter phase, the JCL is fixed -- as you were told already -- and cannot be modified in any way. You must submit another job to include dynamic elements -- because the JCL for the running job cannot be changed.

Either accept that you need a second job, or go back to whoever gave you the assignment and tell them that this method is not possible and therefore the assignment cannot be completed as required.
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Mon Dec 21, 2009 6:42 pm    Post subject:
Reply with quote

Hi Robert,
I completely agree with you. and now doing as per ur suggestions.

Thank You for ur help.

Regards,
kapil.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Dec 21, 2009 6:46 pm    Post subject:
Reply with quote

Robert Sample wrote:
or go back to whoever gave you the assignment and tell them that this method is not possible and therefore the assignment cannot be completed as required.


That what you did?
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Wed Dec 23, 2009 12:47 pm    Post subject:
Reply with quote

Hi Peter,
I have agreed with Robert about the point that second job is needed here. but in my case i m writting datsetname in PS file by internal reader. so it is difficult to submit again one job through internal reader within same job and quite complex also.

Now i m including the PS file in the job so that i can use dataset name which is inside the PS file.

I am a software engineer and not suppose to say no for any work because of technical difficulties. Its my job to provide solutions.

Thanks to all for ur help. icon_smile.gif

Regards,
Kapil.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Wed Dec 23, 2009 5:54 pm    Post subject:
Reply with quote

Quote:
I am a software engineer and not suppose to say no for any work because of technical difficulties. Its my job to provide solutions.
What utter idiocy. If you are a software engineer, it is your job to point out things that either cannot be done at all or cannot practically be done. If you're not doing this, you're not a software engineer, you're a clown masquerading as a software engineer. Further, a software engineer will allow the goal to be dictated but not the method -- you should always be able to specify how you're going to do the requested work (as long as your method meets the site requirements).

I had a manager one time ask me if a complicated request could be done. I came back to him with a complete system proposal showing what he wanted to do could be done at a cost of $9 million. Since his budget at the time was less than $2 million, he decided to take my recommendations and get almost what he wanted for a lot less money.
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Wed Dec 23, 2009 6:52 pm    Post subject:
Reply with quote

@Robert,
kindly read my wordings again. i have used word "technical difficulties". and the example u have given is a finential constrain which u cant solve at all.

Secondly,
In my assignment I have prepared the design and now in implementation part, solving out technical difficulties for reaching my goal.
as i know this is the right way of working because if technical difficulties come we use our knowledge and experience to solve it out rather then going back to say "It cant be done". I dont prefer to give up this much easily.

Quote:
you're a clown masquerading as a software engineer


@all : Please dont take me wrong. I am just doing my assignment, I dont want to waste ur time,but if some one will question my entity then i have to answer.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 23, 2009 8:56 pm    Post subject:
Reply with quote

Hello,

Quote:
so it is difficult to submit again one job through internal reader within same job and quite complex also
Where is the complexity?

It is rather straightforward to generate a JOB and subsequent EXEC and DD statements to run any number of steps in the generated process. Writing to the internal reader is only a matter of changing the DD statement in the generating job.

If you explain the actual requirement someone would be able to offer more usable suggestions.

Possibly, there is something i am missing. . .
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Wed Dec 23, 2009 9:16 pm    Post subject:
Reply with quote

Hi,

If you could put down your code here and let us know how much you have progressed. (A part of the JCL would be helpful) with some explanations to the steps. Then Im sure many will be able to help u a lot easier.

Good luck.
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Thu Dec 24, 2009 1:05 pm    Post subject:
Reply with quote

Hi dick scherrer and vasanthz,
Here is my complete requirement.
In my team, we are having a series of jobs which we need to submit for getting our work done. In these jobs we are having two kind of input :
1. Output from the previous job.
2. Other supportive input file(In Most cases GDG generations). : These files will be having a date at the top of the file which should be same for all the files being used in a job.

My manager asked me to write one job which will submit all the jobs and we should only need to give input to first job.

My Analysis:
I have thought for writing a job which will be having all the above jobs in job steps. Now for getting output of previous step in next step i can use referback. but for identifying the correct GDG generation(dependind upon date field) I have written a proc which will take GDG base and date as input, and will give the GDG generation name in as PS file, depending upon date field.

now i need to do two task symultaniously. I need to call the proc for getting correct GDG generation, before the step being used them. And use the PS file having generation name in the step for executing job step using GDG generations. for this thing i m trying for passing symbolic parameter while calling the proc for generating the PS name dynamically. so that the PS should be unique for each step.

for using the PS file containg GDG generations in job step, i m including that PS file in my Job step, after calling proc which will give required GDG generation.

My progress :
I have done with the proc getting the GDG generations in PS file depending upon the Date field.

Right now i m trying to get unique DD name for writting GDG generations as DD steps in PS file so that i can easily use them in jcl step which using those GDG generations, here including the PS file in jcl will be enough for getting the GDG generations in JCL.

for writting the unique DD name at run time i have used SEQNUM, and it is giving the number which is unpredicatable(Because required GDG generation may be at any place in all GDG generation) . so i cant use SEQNUM for this purpose.here is the code using SEQNUM :

OUTREC=(C'//C',SEQNUM,3,ZD,C'CNTL DD *',/,
C' INCLUDE COND=(1,08,CH,EQ,C''',
C'12/14/09',C'''',C')',/,
C' OUTFIL FNAMES=OUT,',/,
C' OUTREC=(C',
C'''',
C'FILE',
SEQNUM,3,ZD,
C' DD DISP=SHR,',
C'''',C',',/,
C' C',
C'''',
C'DSN=',
17,44,
C'''',
C',11X',
C')',14X)


By above code i m getting below code in output :

//C001CNTL DD *
INCLUDE COND=(1,08,CH,EQ,C'12/14/09')
OUTFIL FNAMES=OUT,
OUTREC=(C'FILE001 DD DISP=SHR,',
C'DSN=PXY0N.ORDER.CYCDATE.G5064V00 ',11X)

here in FILE001, 001 is getting generated by SEQNUM.
Please let me know any other way of getting unique DD name which i can pass or predict while writting the jcl.
One way i can think about passing dd name as a symbolic parameter in OUTREC, but unable to do it.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Dec 27, 2009 2:20 am    Post subject:
Reply with quote

Hello,

Suggest you post some particular data (control info like dataset names as well as some sample data - very little actual data should be needed).

At this point i'm not sure why symbolic(s) would be needed. If you generate the "to be submitted" jcl and control statements, i believe you can generate what is needed and not have to further substitute values.

If you were to set one up by hand what would you eventually submit?

The better "picture" you can show us, the more we may be able to help.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Sun Dec 27, 2009 3:39 am    Post subject:
Reply with quote

Trying a solution with SORT certainly seems a whole lot more complicated than just writing a short Rexx program that reads the data and writes JCL to a temp file and submits it. Is there a reason you don't want to write a program? This couldn't be more than 20 or 30 lines of code plus templates for the JCL. I really don't understand why this is a multi-step process. A single short program can do it all in one step.

If you are planning to use JCL referback in the same job, that won't work. As Robert said, you need all the data set names resolved when the job is submitted. You have nothing to refer back to.

Actually, I don't really see the need to have an intermediate file that contains dates either, but I have to admit that I'm confused by the description because the terminology is confusing (calling procs, dd steps, etc). Dick is right though. A complete (minimal) input and output example is needed.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Dec 27, 2009 6:39 am    Post subject:
Reply with quote

Quote:
technical difficulties
It sounds to me more like a design problem.
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
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 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