Page 1 of 2

JCL to update 15000 entries

PostPosted: Thu Aug 21, 2008 2:59 pm
by jaga123
Hi

I have to change the value of "Region Code" for 15000 user records. I have the 15000 user record's in a DATASET.

The command which is used to change the region code for a single user record is

CHANGE <USER ID> region(AUS)

But, i have to update the region code for 15000 records. So is it possible to do this via JCL? If so, please provide me the steps.

Re: JCL to update 15000 entries

PostPosted: Thu Aug 21, 2008 7:07 pm
by Bill Dennis
Is this an ISPF "CHANGE" command? Add ALL to the command to change all occurences.
CHANGE <USER ID> region(AUS) ALL

If this is some other product or you have special requirements, please explain.

Re: JCL to update 15000 entries

PostPosted: Thu Aug 21, 2008 8:30 pm
by Frank Yaeger
jaga123,

If you want to change all occurrences of '<USER ID>' to 'region(AUS)' in all of your records, you can use DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC FINDREP=(IN=C'<USER ID>',OUT=C'region(AUS)')
/*


If you don't have PTF UK90013, ask your System Programmer to install it.

For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

http://www.ibm.com/systems/support/stor ... /mvs/ugpf/

Re: JCL to update 15000 entries

PostPosted: Mon Aug 25, 2008 4:50 pm
by jaga123
hi all,

Thanks a lot for your assistance.

DFSORT is available in my machine.

My requirement is not to change all occurrences of '<USER ID>' to 'region(AUS)'. It is to change the region code to AUS for all the 15000 user accounts.

for example:
User account is "REFRES"
The Current region code is "UK".
Now i need to change the region code from "UK" to "AUS".

Re: JCL to update 15000 entries

PostPosted: Mon Aug 25, 2008 9:03 pm
by Frank Yaeger
My requirement is not to change all occurrences of '<USER ID>' to 'region(AUS)'. It is to change the region code to AUS for all the 15000 user accounts.


It's still not clear what you mean by this. What are the "rules" for identifying the region codes you want to change? What do the input records look like? What is it in a record that tells you the region code needs to be changed in that record?

If you want to change 'UK' to 'AUS' anywhere in your records, you can use these DFSORT control statements (similar to the previous ones):

  OPTION COPY
  INREC FINDREP=(IN=C'UK',OUT=C'AUS')


If you want to change 'x1', 'x2' and 'x3' to 'AUS' anywhere in your records, you can use these DFSORT control statements:

  OPTION COPY
  INREC FINDREP=(IN=(C'x1',C'x2',C'x3'),OUT=C'AUS')

Re: JCL to update 15000 entries

PostPosted: Tue Aug 26, 2008 2:36 pm
by jaga123
My input record is an User account like "TER01"(Login account to Mainframe MVS OS). "TER01" have Name, Salary number, Region Code etc.
Similarly, we have 15000 user accounts (like TER02, TER03..... TER15000).
The Security tool loaded over the OS replaces the default READY prompt with a different command prompt.
In the command prompt, i used to type,
CHANGE TER01 Region(AUS)
to change the region code of user account "TER01". This command works fine. But i can't do the same for 15000 user accounts by giving the command one by one manually.

I know that i can write a JCL that includes the Change command like above for 15000 user accounts. But i don't want to do that as it requires so much of manual work.

Hope this may explain clearly about my requirement. Is there any other way to do this?

Re: JCL to update 15000 entries

PostPosted: Tue Aug 26, 2008 8:47 pm
by Frank Yaeger
It seems to me that any method you use would require identifying the 15000 user accounts in some way. If you don't have them in a file, then you'd have to type them in. If you do have them in a file, you could extract them automatically and use them in a job but I can't tell you what that job should be since I still don't know how the user account relates to the region code. You keep referring to commands that don't mean anything to me. You don't seem to be able to answer my questions or describe what you want to do in a general way with an example, so I can't help you.

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 1:35 am
by dick scherrer
Hello,

Please post 5 input "user account" records showing the fields you mentioned and their position in the record. Also post the recfm and lrecl of your input file.

Then post the 5 CHANGE statements you want generated from the 5 sample input records. As it will be used as "sysin" input, i suspect this file will be lrecl 80.

Please use the "Code" tag when posting the sample input and output.

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 2:11 am
by Frank Yaeger
Dick,

Are you assuming that:

CHANGE TER01 Region(AUS)

means if the user account at positions a-b = 'TER01', then change the region code at positions c-d to 'AUS'?

And how does showing 5 CHANGE statements help with 15000 CHANGE statements? As I said, unless the 15000 CHANGE statements are already in a file (which I've asked about before and not received confirmation of), how will they be generated - by hand? I wouldn't want to type in 15000 statements of any kind. Seems like the OP wants to pull these 15000 changes out of thin air.

I think the key here is:

I know that i can write a JCL that includes the Change command like above for 15000 user accounts. But i don't want to do that as it requires so much of manual work.


If the 15000 user accounts don't exist some place from which they can be extracted automatically, then they would have to be entered manually. The OP has given no indication that these 15000 user accounts exist some place other than in his head. If they do exist in a file, then he has to tell us where in that file they exist and how they can be identified for automatic extraction.

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 3:20 am
by dick scherrer
Hi Frank,

No, i'm guessing that there is a file that has ID, name, salary, region, and other fields with 15000 entries.

From these records, CHANGE records need to be created which will be a combination of literals and values from the file. The generated control statements would look like:
CHANGE idfromfile REGION(regnfromfile)
The CAPS are literals and the other 2 fields are from the file.

Once created, the "commands" could be issued in some batch job.

If i've understood. . . .