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

Replace on multiple columns using sort.


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnsnaresh

New User


Joined: 16 May 2006
Posts: 7
Location: pune

PostPosted: Sat Mar 10, 2012 6:11 pm
Reply with quote

HI all,

I am using the below sort, job completes sucess full , only one filed is replaced '31.01.2012' the other field are not replaced. tried sevral options but not got thru.

Code:
 //SYSIN DD *                                       
   OPTION COPY                                       
   INREC IFTHEN=(WHEN=(5,10,CH,EQ,C'29.02.2012'),   
         OVERLAY=(5:C'31.01.2012')),                 
         IFTHEN=(WHEN=(56,2,CH,EQ,C'02'),           
         OVERLAY=(56:C'01')),                       
         IFTHEN=(WHEN=(58,4,BI,EQ,20120309),         
         OVERLAY=(58:+20120204,TO=BI,LENGTH=4))     
 /*                                                 
 /*

Please suggest.
My requiremnt is to replace the valuse on three fileds on evrey reocd
Code:
10 DATE                     29.02.2012  POSTION 5
10 MONTH                  02               POSTION 56
10 CNTL-NO               20120309     POSTION 58


Thanks,
Naresh
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Mar 10, 2012 6:18 pm
Reply with quote

hit=next
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: Sat Mar 10, 2012 6:35 pm
Reply with quote

Why is this an "interview question"?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Mar 10, 2012 7:05 pm
Reply with quote

as said over and over ...
DO NOT POST SCREENSHOTS

a plain text cut and paste with the code tags is more than enough !

the screen shot was deleted.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Sat Mar 10, 2012 11:45 pm
Reply with quote

Hi Naresh,

Please use below mentioned sort card.


Code:
 SORT FIELDS=COPY                                         
 INREC IFTHEN=(WHEN=(5,10,CH,EQ,C'29.02.2012'),           
          OVERLAY=(5:C'31.01.2012'),HIT=NEXT),           
          IFTHEN=(WHEN=(56,2,CH,EQ,C'02'),               
          OVERLAY=(56:C'01'),HIT=NEXT),                   
          IFTHEN=(WHEN=(58,4,BI,EQ,20120309),             
          OVERLAY=(58:+20120204,TO=BI,LENGTH=4))


Input:

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ABCD29.02.2012                                         0220120309       



Output:

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
ABCD31.01.2012                                         0120120309     
Back to top
View user's profile Send private message
pnsnaresh

New User


Joined: 16 May 2006
Posts: 7
Location: pune

PostPosted: Sun Mar 11, 2012 1:45 pm
Reply with quote

Thanks parsad will check on this tomorrow and will let you know.
Naresh.
Back to top
View user's profile Send private message
pnsnaresh

New User


Joined: 16 May 2006
Posts: 7
Location: pune

PostPosted: Sun Mar 11, 2012 6:05 pm
Reply with quote

I Just tested this . I could replace the data now.

Thanks a lot saiprsad...you have solved my prod issue.

Thanks team.

Thanks & Regards,
Naresh.P
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: Sun Mar 11, 2012 7:04 pm
Reply with quote

Not a word for dbz, who gave you the solution seven minutes after you posed the question?

How could this be a "prod" issue? Can't have got through testing, as it plain didn't work.

Have you looked in your manual now to see why the HIT=NEXT fixed the problem?

For the future, note that DFSORT questions go in the DFSORT forum, Syncsort questions in the JCL forum. Interview Questions go in this forum.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 11, 2012 7:16 pm
Reply with quote

Quote:
Not a word for dbz, who gave you the solution seven minutes after you posed the question?

Bill, shame on You icon_biggrin.gif
after more than 2000 posts You haven' t learned yet that people around here do not give a f**k about suggestions and hints and want ready to run solutions
( for some of them it is even too much work to have to retype them icon_cool.gif )
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: Sun Mar 11, 2012 7:34 pm
Reply with quote

It's like a mailshot. I don't expect 100% replies, nor 100% conversion of replies :-)
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top