MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pass a Parm as a Temp. Dataset
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Sep 10, 2003 1:40 am    Post subject: Pass a Parm as a Temp. Dataset Reply with quote

All,

The objective is this, to code a parm to a program, in a temp.dataset. If this is not possible, what are the work arounds.

Code:


//STEP1 EXEC PGM=SORT
//SORTIN DD *
  SOMEDATA
/*
//SORTOUT DD DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
//SYSOUT  DD SYOUT=*
//STEP2  EXEC PGM=MYCOBOLPROG,PARM=(THE TEMP.DATASET OF THE PREVIOUS STEP)
//DD1....MY FILE ALLOCATIONS GO HERE




Cheers,
Coolman.
________
medical marijuana


Last edited by coolman on Sat Feb 05, 2011 1:28 am; edited 1 time in total
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Sep 10, 2003 2:23 am    Post subject: Reply with quote

Coolman,
Would you not be reading the temp dataset created above? Or, you want the name of the temporary dataset? If it is the latter, is there a problem with having a cataloged dataset?

I mean, I do not quite understand the main requirement.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Sep 10, 2003 3:35 am    Post subject: Reply with quote

Cogito,
Good to see you back. BTW, have you quit the other forum. Im not seeing you at all these days.

Coming on to the subject, my first sort step would write out a temp file, which will contain some parm information to the subsequent COBOL program. Answering your question, I would not reading the temp dataset.
Im not able to appreciate your idea behind using a cataloged dataset, what purpose its going to serve.

The objective is that there is a dataset, which has some information, now that dataset has to be re-formatted and passed as parm to a subsequent job step. Now, that is the reason why I had asked whether if parm can be passed as a temporary dataset. (I don't think it can be done, but wanted to know if somebody has "discovered" some workarounds for this).
Also, I dont want to change the program in the next step to read the file itself and re-format the parm.

Cheers,
Coolman.
________
vaporizer review


Last edited by coolman on Sat Feb 05, 2011 1:29 am; edited 1 time in total
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Sep 10, 2003 3:47 am    Post subject: Reply with quote

Thanks Coolman.

I am very much present in both the fora! I am Nagesh_S there. Something happened to my ID there.

At first glance, I was not sure. I could make only 2 things. One, you want to read the dataset and the other, you wanted to read only the dataset name. For the latter, a cataloged dataset seems more easy.

But, why send the dataset via a PARM? Even if it were possible, you know that PARM cannot exceed 100 chars. At any rate, a dataset is definitely greater than PARM. So, why not read the temp dataset?

Or, code a step using DFSORT such that the contents of the relevant dataset appears in PARM. That is, something like,

OUTREC FIELDS=(C'// PARM=(',1,nn,C')')

where, 1,n points to the data in the temporary dataset. The SORTOUT can point to INTRDR.

You won't do the above, would you? Razz
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Sep 10, 2003 4:45 am    Post subject: Reply with quote

Cogito,

I have been through your profile, and know your name to be Nagesh Subrahmanyam. In fact, I had guessed it(not only with the name, but with your answers as well), but your location used to be Mumbai and now its banglore and that cast a doubt in my mind. Anway, b2b, couple of questions and assumptions here:

1. Parm will hardly be only 10 characters max.

Quote:

So, why not read the temp dataset?


Do you say that I have to read it inside the COBOL Program?If Yes, the answer is no, im not able(allowed) to do it. If no, how else should I read it.

Coming to the DFSORT OUTREC, let me take this example.

Code:

//STEP1  EXEC PGM=SORT
//SORTIN DD *
ACCT
/*
//SORTOUT DD DSN=&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
//SYSOUT   DD SYSOUT=*
//SYSIN     DD *
  OPTION COPY
  OUTREC FIELDS=(C'//PARM=(',1,4,C')')
/*
//STEP2    EXEC PGM=SOMECOBOLPGM,
//DSN1     DD DISP=SHR,DSN=MY.DSN.1
//


Now Inside my COBOL Program, I have a linkage section and an accept statement
Now, how do i pass the SORTOUT created in STEP1 to SOMECBOLPGM in STEP2. Is there a way for this? You have pointed out abt using an INTRDR, again which Im not allowed to do that part.

Hope this clarifies everything.

Cheers,
Coolman.

P.S : I have also proposed a REXX solution to them, but didnt go thro'
________
Ferrari 365


Last edited by coolman on Sat Feb 05, 2011 1:29 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Sep 10, 2003 5:17 am    Post subject: Reply with quote

coolman,

IF it is a pure cobol program then pass the parms via SYSIN

Code:

//SYSIN    DD DSN=YOUR OUTPUT FROM SORT,
//            DISP=SHR


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Sep 10, 2003 5:32 am    Post subject: Reply with quote

Coolman,
Yes. I am in Banglore nowadays.

I was suggesting (what Kolusu has pointed) that, instead of using PARM, LINKAGE SECTION, process the temp dataset as just any other dataset.

I was wondering, why were you insisting to read via PARM, LINKAGE SECTION, etc. instead of plain old sequential dataset processing.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Sep 10, 2003 5:38 am    Post subject: Reply with quote

Cogito,

With sysin you don't have to open/read/closse the file.

Hope this helps..

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Sep 10, 2003 7:21 am    Post subject: Reply with quote

Of course, Kolusu.

I did not specifically meant SYSIN. But, of course, SYSIN has that advantage of no OPEN/READ/CLOSE.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Sep 10, 2003 7:49 am    Post subject: Reply with quote

My apologies guys, Jesus, it didnt even occur to me, infact I completely forgot about SYSIN (I was looking out for the most complex solutions)

Thanks Kolusu and Nagesh

Cheers,
Coolman.
________
vaporizer forum


Last edited by coolman on Sat Feb 05, 2011 1:29 am; edited 2 times in total
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Sep 10, 2003 8:00 am    Post subject: Reply with quote

You are welcome.

BTW, Coolman, I do not know your name.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Oct 07, 2003 7:53 am    Post subject: Reply with quote

Kolusu,
I was wondering, if the scenario was slightly different.
Say we have a file, which has a date(gets updated everyday). Now, i want to execute a job everday which is creating some files. Now, if one of the qualifiers for that file is the rundate(present in the file), how do we go about doing it. Couple of ways of doing it.

1. Run 2 jobs, the first job(SORT job) creating an SET statement, which can be included in the actual job or alternatively, submitting the actual directly to INTRDR, from the 1st job (Add another step to the SORT job)
2. Using skeletons.

Are there any other workarounds or rather simpler way of doing it ??

Cheers,
Coolman.
________
free vaporizer


Last edited by coolman on Sat Feb 05, 2011 1:31 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Oct 07, 2003 8:28 am    Post subject: Reply with quote

coolman,

If I understand correctly , You want to create a dataset with the parm-value as one of the qualifier.If that is true then the easiest way I can think of is to create the datasets as usual and then do a rename of the dataset.The only hitch is that you cannot rename a tape dataset. You can generate the rename cards in the program which reads the parm-value.

Let me know if my assumptions are correct and I will post the code to generate the rename cards in the program

Hope this helps...

cheeers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Oct 07, 2003 8:47 am    Post subject: Reply with quote

Got you sir, the method you had suggested would involve a single job with 1 more step added.

One small clarfication, why not generate the rename cards in a separate step instead of the program. Also, "The usual datasets have to be hardcoded in the rename sysin card".

Correct me if im wrong.

Cheers,
Coolman.
________
mexico city hotels


Last edited by coolman on Sat Feb 05, 2011 1:31 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Oct 07, 2003 9:39 am    Post subject: Reply with quote

Coolman,

I would really appreciate if you can stop addressing me as SIR. I am also one of you.

I thought it is a good idea to generate the rename cards in the program which updates the parm-value.

Quote:

The usual datasets have to be hardcoded in the rename sysin card


Yes but you can pass that dataset names as another parmfile.so in future if you need to add some more datasets then you can change one parm.

If you want I have a sample program which generates rename cards and I can mail it to you.

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group