View previous topic :: View next topic
|
Author |
Message |
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Hi ,
Need all veterans help for solving the below problem.
My input file is as below, which is in fixed length formaT:
Quote: |
01CDC+12345.90
02CDC-134500.00
01FTG-145678.89
01RFR-345670.00
|
My requirement is flip the sign for
- 'CDC' to ''-' whenever the sign is '+',
- 'RFR to ''+' whenever the sign is '-'
Can this be done using JCL sort? Please help
[/quote] |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(3,3,CH,EQ,C'CDC',
AND,6,1,CH,EQ,C'+'),
OVERLAY=(6:C'-')),
IFTHEN=(WHEN=(3,3,CH,EQ,C'RFR',
AND,6,1,CH,EQ,C'-'),
OVERLAY=(6:C'+')) |
Something like that. You know deep down it's not JCL, don't you? You know you are not updating a VSAM file in place? You know that you posted in the wrong forum (DFSORT or SYNCSORT depending on the product you use)? |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Thanks Bill.
Yes its JCL and am not using VSAM files.
I am sorry if i have posted in the wrong forum, will take care in future |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Sometimes I wonder why such questions are being entertained when there is a plenty of information available on the internet on how to do this.
This could have been resolved with a minimal effort of 10 mins browsing the internet.
Not doing research before posting the question should be considered a crime on the forum |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
It is a crime in most forums hence many sghort answers referring OP/TS to colleagues, manuals, internet. But the bigger crime, perhaps, is not reading the forum rules where such things are indicated. |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Bill,
How about this, avoid couple of overlay's ?
Code: |
//SYSIN DD *
INREC OVERLAY=(3:3,4,CHANGE=(4,C'CDC+',C'CDC-',
C'RFR-',C'RFR+'),
NOMATCH=(3,4))
OPTION COPY
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Looks good to me :-) |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Good work Magesh |
|
Back to top |
|
|
|