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
 

 

Replace on multiple columns using sort.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Replace on multiple columns using sort.
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: 6968
Location: porcelain throne

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

hit=next
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Mar 10, 2012 6:35 pm    Post subject: Reply to: Replace on multiple columns using sort.
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Sat Mar 10, 2012 7:05 pm    Post subject: Reply to: Replace on multiple columns using sort.
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    Post subject:
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    Post subject: Reply to: Replace on multiple columns using sort.
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sun Mar 11, 2012 7:04 pm    Post subject: Reply to: Replace on multiple columns using sort.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Sun Mar 11, 2012 7:16 pm    Post subject: Reply to: Replace on multiple columns using sort.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sun Mar 11, 2012 7:34 pm    Post subject: Reply to: Replace on multiple columns using sort.
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


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