Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

JCL to Update record using other file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Fri Oct 04, 2013 7:31 pm    Post subject: JCL to Update record using other file
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

Site Director


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

PostPosted: Fri Oct 04, 2013 7:41 pm    Post subject:
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: 72
Location: Chennai

PostPosted: Fri Oct 04, 2013 7:46 pm    Post subject:
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

Site Director


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

PostPosted: Fri Oct 04, 2013 8:43 pm    Post subject:
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: 72
Location: Chennai

PostPosted: Fri Oct 04, 2013 8:48 pm    Post subject:
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

Site Director


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

PostPosted: Fri Oct 04, 2013 10:00 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Fri Oct 04, 2013 10:09 pm    Post subject: Reply to: JCL to Update record using other file
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us