View previous topic :: View next topic
|
Author |
Message |
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
Hi All,
I have requirement to update record for the below sinerio,
We need to copy from the input file the position 22 to 25 and update in to
output file the position 22 to 25 for the records 6 to 8
input file
Code: |
saravanan25mainstreetyyyy1234
saravanan25mainstreetzzzz1234
saravanan25mainstreetaaaa1234 |
output file:
Code: |
saravanan25mainstreetxxxx1234
saravanan25mainstreetxxxx1234
saravanan25mainstreetxxxx1234
saravanan25mainstreetxxxx1234
saravanan25mainstreetxxxx1234
saravanan25mainstreetyyyy1234
saravanan25mainstreetzzzz1234
saravanan25mainstreetaaaa1234
saravanan25mainstreetxxxx1234
saravanan25mainstreetxxxx1234 |
Can you please how to created JCL for this sinaerio |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You neeed to post the "rules" for processing the data.
For example - where did the xxxx records come from?
Is there only one input file? |
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
dick scherrer wrote: |
Hello,
You neeed to post the "rules" for processing the data.
For example - where did the xxxx records come from?
Is there only one input file? |
There is no rules.Just to update from input file the char 22 to 25 to the output file 22 to 25 ( not 'xxxx' .if any char) for the rec 6 to 8.
i used the below code but i got empty file
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XMMD01.DEVK.TXD.D131004.TEST,DISP=SHR
//SORTOUT DD DSN=XMMD01.DEVK.TXD.D131004.TEST1,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY,SKIPREC=5,STOPAFT=8
OUTREC FIELDS=(1:1,21,22,4,26:4)
/* |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
There is no rules.Just to update from input file the char 22 to 25 to the output file 22 to 25 ( not 'xxxx' .if any char) for the rec 6 to 8. |
YES, there are "rules". . . .
Your input shows 3 records. How are there records 6-8?
Your code says
SKIPREC=5,STOPAFT=8
but there are only 3 records input. WHich is probably why the output file is empty.
What you want may be perfectly clear to you, but it is NOT to everyone else. |
|
Back to top |
|
|
cmsmoon
New User
Joined: 17 Jun 2010 Posts: 75 Location: Chennai
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
There is no rules.Just to update from input file the char 22 to 25 to the output file 22 to 25 ( not 'xxxx' .if any char) for the rec 6 to 8. |
YES, there are "rules". . . .
Your input shows 3 records. How are there records 6-8?
Your code says
SKIPREC=5,STOPAFT=8
but there are only 3 records input. WHich is probably why the output file is empty.
What you want may be perfectly clear to you, but it is NOT to everyone else. |
I would like to skip output records ( first 5 record)s to update and the updatation would happen from 6 to 8th record in output file |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please ask a co-worker to help you word your English dialog for this topic. One of our biggest challenges is an English forum with many members who did not have English as their primary/first language.
Quote: |
I would like to skip output records ( first 5 record)s |
How can the first 5 output records be skipped when there are not even 5 input records? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Your code is doing what you told it to. It is ignoring the first five records. Since you have only thee records, SORT then processes an empty file. You got an empty file. If you want to confirm this add:
Code: |
OUTFIL BUILD=(80X),REMOVECC,HEADER1=(C'WORKING') |
|
|
Back to top |
|
|
|