View previous topic :: View next topic |
Author |
Message |
davinski.bby Beginner
Joined: 30 Jul 2007 Posts: 31 Topics: 10
|
Posted: Thu Oct 18, 2007 12:18 pm Post subject: Updating Records in VSAM file using JCL |
|
|
i need to update certain certain records given a condition in a vsam file using JCL .
example:
Code: | Y0000JOE
Y0001JOHN
Y0002MARY
Y0003MIKE
Y0004TOM
|
I have a list of names and if the name is matching the file, i will need to update the first element of the record.
my list:
JOE
JOHN
expected output:
Code: | X0000JOE
X0001JOHN
Y0002MARY
Y0003MIKE
Y0004TOM
|
Can this be done by using a JCL?
Thanks. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Oct 18, 2007 12:23 pm Post subject: |
|
|
Not by JCL - you need a program - either written by yourself or more likely using whichever sort tool your shop uses. search on matching files in the utilities forum for a start. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
davinski.bby Beginner
Joined: 30 Jul 2007 Posts: 31 Topics: 10
|
Posted: Thu Oct 18, 2007 2:58 pm Post subject: |
|
|
What Sort Tool can i use? thanks. |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Fri Oct 19, 2007 12:10 am Post subject: |
|
|
davinski,
The below job gives you the desired results.
Code: | //S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
Y0000JOE
Y0001JOHN
Y0002MARY
Y0003MIKE
Y0004TOM
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(6,3,CH,EQ,C'JOE',OR,6,4,CH,EQ,C'JOHN'),
OVERLAY=(1:C'X'))
/* |
Output:
Code: | X0000JOE
X0001JOHN
Y0002MARY
Y0003MIKE
Y0004TOM |
|
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 19, 2007 1:41 am Post subject: |
|
|
vkphani
Always try to use OUTREC where ever possible, avoid using INREC. This improves the efficiency of Your SORT JCL. _________________ cHEERs
krisprems |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Fri Oct 19, 2007 1:48 am Post subject: |
|
|
krisprems wrote: | vkphani
Always try to use OUTREC where ever possible, avoid using INREC. This improves the efficiency of Your SORT JCL. |
Kris,
Is it? I am not aware of this. Thanks for letting me know.
davinski,
Just replace INREC by OUTREC in the above JCL. You will get teh same output. |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 19, 2007 3:38 am Post subject: |
|
|
vkphani
yes its true, but may not find the difference in performance untill and unless you process huge file's.
Note Some times by using INREC also you can improve the efficiency, consider a scenario like this:
In i/p file if you have data of LRECL=3000 and you require the o/p of LRECL=100 then in this scenario use INREC and reformat the records then perform SORT.
Since the flow of SORT would be like this:
1. INREC
2. SORT/SUM FIELDS
3. OUTREC _________________ cHEERs
krisprems |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 19, 2007 3:42 am Post subject: |
|
|
You can refer to this link for further details
INREC Statement Notes _________________ cHEERs
krisprems |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Fri Oct 19, 2007 4:12 am Post subject: |
|
|
Thaks for the link kris. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri Oct 19, 2007 8:11 am Post subject: |
|
|
When I read the link provided there is no mention of OUTREC being better performance than INREC. Only that it's more convenient using OUTREC because the SORT FIELD positions are the original record locations.
As kris admits, INREC is actually better for performance when you can reduce the record to only the meaningful fields. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 19, 2007 9:32 am Post subject: |
|
|
Bill Dennis
Quote: |
yes its true, but may not find the difference in performance untill and unless you process huge file's.
|
Please conceterate on this statement too, for the scenario that davinski.bby has asked, if its a pretty huge file OUTREC is better choice. _________________ cHEERs
krisprems |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Oct 19, 2007 10:36 am Post subject: |
|
|
Actually, for a COPY, there is usually no difference in performance between INREC and OUTREC. For a SORT, there can sometimes be a difference in performance. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
|
|