Page 1 of 1

Replace low value with space at 587th position !!

PostPosted: Mon Jan 26, 2009 9:49 pm
by athul009
I want to replace low value with space at 587th position and replace X'2C' with space at 588th position !!
By going through some examples on web search , I think of two methods:

1)
//H081107 EXEC PGM=ICEMAN
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD DSN=DMET.A0RD7102.FTP.D0120.KEEP12,DISP=SHR
//SORTOUT DD DSN=DMET.A0RD7102.FTP.D0120.KEEP12.CLEAN,
// DISP=(,CATLG,DELETE),
// UNIT=3390,SPACE=(CYL,(200,100),RLSE)
//*
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1:1,586,CHANGE=(587,X'00',X'40',588,X'2C',X'00'))
//*

I am getting the following Error in Spool :
ICEM_CHANGE_error.jpg


2) While trying for another option using FINDREP :

//SYSIN DD *
OPTION COPY
INREC FINDREP=(STARTPOS=587,ENDPOS=588,IN=(X'00',X'2C'),OUT=X'40'))
//*

I am getting the following error in SYSOUT Spool :
ICEM_FINDREP_error.jpg


Please let me know, what might be the problem in any Or both the examples.
Thanks a lot!

Re: Replace low value with space at 587th position !!

PostPosted: Tue Jan 27, 2009 1:53 am
by Frank Yaeger
Your first attempt is wrong because you seem to have pulled the syntax out of a hat. It has no relation to the actual correct syntax.
The correct DFSORT statements would be:

  OPTION COPY                                                     
  INREC OVERLAY=(587:587,1,CHANGE=(1,X'00',X'40'),NOMATCH=(587,1),
    588,1,CHANGE=(1,X'2C',X'40'),NOMATCH=(588,1))                 


Here's another way to do the same thing:

  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(587,1,BI,EQ,X'00'),OVERLAY=(587:X'40'),   
    HIT=NEXT),                                                   
   IFTHEN=(WHEN=(588,1,BI,EQ,X'2C'),OVERLAY=(588:X'40'))         


Your second attempt is closer - you just need to remove the last right paren. But you need z/OS DFSORT PTF UK90013 (July, 2008) to use FINDREP and you don't have that PTF installed. Ask your System Programmer to install it (it's free).

In the future, please don't use screenshots as they are difficult to view and impossible to copy/paste. Just use plain inline text.