IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to Update record using other file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 04, 2013 7:31 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 04, 2013 7:41 pm
Reply with quote

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
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 04, 2013 7:46 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 04, 2013 8:43 pm
Reply with quote

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
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Oct 04, 2013 8:48 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 04, 2013 10:00 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Oct 04, 2013 10:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top