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

If i get 2 or 0 in 218 Posotion then i need replace with X


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Sat Mar 31, 2007 11:08 pm
Reply with quote

Hi,

Could you please help me out on the below.

I have file.If i get 2 or 0 in 218 Posotion of my input file then i need to replace with X and if get 1 inthat place then i need to replace it with "Y".


Is this is possible with a sort card, if so could you please help me with its Syntac.

Thanks,

Murali.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Mar 31, 2007 11:31 pm
Reply with quote

ITHAKOTA Murali wrote:
I have file.If i get 2 or 0 in 218 Posotion of my input file then i need to replace with X and if get 1 inthat place then i need to replace it with "Y".
I probably have it wrong, but this seem to be what you aare looking for
Code:
OUTREC IFTHEN=(WHEN=(218,1,CH,EQ,C?0?),OVERLAY=(218:C?X?)),
       IFTHEN=(WHEN=(218,1,CH,EQ,C?2?),OVERLAY=(218:C?X?)),
       IFTHEN=(WHEN=(218,1,CH,EQ,C?1?),OVERLAY=(218:C?Y?))
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Apr 02, 2007 2:24 am
Reply with quote

Murali,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=...  input file                             
//SORTOUT DD DSN=...  output file                                     
//SYSIN    DD    *                                               
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(218,1,SS,EQ,C'0,2'),OVERLAY=(218:C'X')),   
        IFTHEN=(WHEN=(218,1,CH,EQ,C'1'),OVERLAY=(218:C'Y'))     
/*
Back to top
View user's profile Send private message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Mon Apr 02, 2007 3:04 pm
Reply with quote

Hi,

Firstly I would like to thank you for your help. I have tried both the sort cards, but both abended. I could understand the sort card with INREC, but I'm afraid the OUTREC one is incorrect. I would like to once again put my problem before you, so that we can be sure my query is understood properly.

I have a file in which in the one byte field located at the 218th position I will be getting values of 2 or 1 or 0. When I get 2 or 0 I need to replace it with X and write it to the output. When I get value of 1 in that field I need to replace it with Y and write it to the output. This I want to do using a Sort Card, is this feasible. That is I'm gonna change a numeric filed value into a Character value.

I hope I'm clear this time. Could you please let me know why I'm getting an abend. Is it because I'm trying to change a numeric data to character or is it because of something else.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 02, 2007 3:22 pm
Reply with quote

You are right, duped the line and didn't finish the updating correctly.

The problem is understood, what errors or abends occured when you used Frank's sample? Please post your jcl and control cards. Please post your outputs showing the error/abend.
Back to top
View user's profile Send private message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Mon Apr 02, 2007 3:54 pm
Reply with quote

I'm posting the SYSOUT of the abended job.

I could not paste the screen shot here ...... hence providing the details as below ...

SYNCSORT FOR Z/OS 1.2.2.2R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.7.1
PRODUCT LICENSED FOR CPU SERIAL NUMBER 5C01E, MODEL 2084 305 LICEN
SYSIN :
OPTION COPY
INREC IFTHEN=(WHEN=(218,1,SS,EQ,C'0,2'),OVERLAY=(218:C'X')),
IFTHEN=(WHEN=(218,1,CH,EQ,C'1'),OVERLAY=(218:C'Y'))
WER276B SYSDIAG= 36496, 878979, 878979, 1286391
WER164B 8,412K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 2,520K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER224A SORTIN NOT DEFINED
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,

The below is the JCL

STEP145 EXEC PGM=ICEMAN
********************************************************************
* STEP145 IN THE GEM PLUS FILE CHANGE THE CARDS PER CARRIER *
* FIELD VALUES (2 AND 0 AS X AND 1 AS Y) *
* RESTART PROCEDURE: RESTART=IAR234.STEP145 *
* *
********************************************************************
*
INREC DD DSN=IDT0.SATYA.C1.ISAR.FXB.ISTGE.G22V00.S1,
DISP=SHR
*
OUTREC DD DSN=IDT0.SATYA.C1.ISAR.FXB.IAR234.ISB020.SORT.SS,
DISP=(NEW,CATLG,DELETE),
UNIT=&DISK,
SPACE=(&CYL,(5,5),RLSE),
DCB=(RECFM=FB,LRECL=1104,BUFNO=16)
*
SORTWK01 DD UNIT=&DISK,SPACE=(&CYL,(5,5),,CONTIG)
SORTWK02 DD UNIT=&DISK,SPACE=(&CYL,(5,5),,CONTIG)
SORTWK03 DD UNIT=&DISK,SPACE=(&CYL,(5,5),,CONTIG)
SORTWK04 DD UNIT=&DISK,SPACE=(&CYL,(5,5),,CONTIG)
SORTWK05 DD UNIT=&DISK,SPACE=(&CYL,(5,5),,CONTIG)
SYSIN DD DSN=IDT0.SATYA.ACMOBIUS(SORTSS),DISP=SHR
*
SYSOUT DD SYSOUT=*
SYSPRINT DD SYSOUT=*
SYSDBOUT DD SYSOUT=*
SYSUDUMP DD SYSOUT=*
*

Thank you for such a quick response.
Back to top
View user's profile Send private message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Mon Apr 02, 2007 3:59 pm
Reply with quote

The sort card is coded as

OPTION COPY
INREC IFTHEN=(WHEN=(218,1,SS,EQ,C'0,2'),OVERLAY=(218:C'X')),
IFTHEN=(WHEN=(218,1,CH,EQ,C'1'),OVERLAY=(218:C'Y'))
Back to top
View user's profile Send private message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Mon Apr 02, 2007 4:08 pm
Reply with quote

Details of the abend .....

J E S 2 J O B L O G -- S Y S T E M N C S H -- N O D E H 2 6 1 N J E

---- MONDAY, 02 APR 2007 ----
IRR010I USERID SDUDDU IS ASSIGNED TO THIS JOB.
ICH70001I SDUDDU LAST ACCESS AT 05:23:09 ON MONDAY, APRIL 2, 2007
$HASP373 U1AR2340 STARTED - INIT CV - CLASS B - SYS NCSH
SURF920I STEP START: JOB=U1AR2340 STEP=STEP145 PGM=ICEMAN STEP#=001
IEF403I U1AR2340 - STARTED - TIME=06.09.01
X370500I U1AR2340,IAR234,OUTREC,IDT0.SATYA.C1.ISAR.FXB.IAR234.ISB020.SORT.SS IN
IEF450I U1AR2340 STEP145 IAR234 - ABEND=S000 U0016 REASON=00000000 173
TIME=06.09.01
SURF931I STEP ENDED: JOB=U1AR2340 STEP=STEP145 CC=U0016
- --TIMINGS (MINS.)-- ----PA
-JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK SERV PG PAGE
-U1AR2340 IAR234 STEP145 U0016 64 .00 .00 .00 611 0 0
SURF920I STEP START: JOB=U1AR2340 STEP=STEP150 PGM=SORT STEP#=002
SURF931I STEP ENDED: JOB=U1AR2340 STEP=STEP150 CC=BBBBB
-U1AR2340 IAR234 STEP150 FLUSH 0 .00 .00 .00 0 0 0
SURF920I STEP START: JOB=U1AR2340 STEP=STEP160 PGM=ISBAR020 STEP#=003
SURF931I STEP ENDED: JOB=U1AR2340 STEP=STEP160 CC=BBBBB
-U1AR2340 IAR234 STEP160 FLUSH 0 .00 .00 .00 0 0 0
IEF404I U1AR2340 - ENDED - TIME=06.09.01
SURF934I JOB ENDED: JOB=U1AR2340 HIGHEST CC=U0016
-U1AR2340 ENDED. NAME-CMS - POSTING TOTAL CPU TIME= .00 TOTAL ELAPSE
$HASP395 U1AR2340 ENDED
ATISTICS ------
EXECUTION DATE
S READ
UT PRINT RECORDS
UT PUNCH RECORDS
UT SPOOL KBYTES
TES EXECUTION TIME
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 02, 2007 4:11 pm
Reply with quote

From your previous post

INREC IFTHEN=(WHEN=(218,1,SS,EQ,C'0,2'),OVERLAY=(218:C'X')),
IFTHEN=(WHEN=(218,1,CH,EQ,C'1'),OVERLAY=(218:C'Y'))
WER276B SYSDIAG= 36496, 878979, 878979, 1286391
WER164B 8,412K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 2,520K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER224A SORTIN NOT DEFINED
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,

The below is the JCL
Back to top
View user's profile Send private message
ITHAKOTA Murali

New User


Joined: 31 Mar 2007
Posts: 6
Location: Florida

PostPosted: Mon Apr 02, 2007 4:26 pm
Reply with quote

I got it. The error is in the DD name. I have changed it & the job went fine. Verified the file, its as required. Thank you so much.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts To replace jobname in a file with ano... SYNCSORT 12
No new posts Conditional replace values in output ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top