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: 6966
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: 7225

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: 10202
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: 7225

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: 10202
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: 7225

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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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