View previous topic :: View next topic
|
Author |
Message |
Digvijay Singh
New User
Joined: 20 Apr 2022 Posts: 99 Location: India
|
|
|
|
Hi All,
Hope you all doing good.
I am trying to prepare one sort card.
Code: |
sontin file :
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
VIEW QSYS.SORT.RC.CODE
Command ===>
****** ***************************** Top of Data **********
000001 &ENV RITM&TIRID MESSAGE: P327384 J0016833 RC=0000
****** **************************** Bottom of Data |
********
My include condition is if above input file has RC=0000
i want my sortout file to look like below :
Code: |
sortout file :
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
VIEW QSYS.SORT.RC.CODE
Command ===>
****** ***************************** Top of Data **********
000001 &ENV RITM&TIRID MESSAGE: P327384 J0016833 RC=0012 JCK
****** **************************** Bottom of Data ********
[code][/code] |
basically i wan to manuplate the Return code if it's 000 i want it to make it RC=0012(my requirment is like that)and append JCK after RC=0012
[/code]
Any small help or suggestion i am trying to but not getting all the content |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
FINDREP=(INOUT=(C' RC=0000',C' RC=0012 JCK'),SHIFT=YES))
END |
|
|
Back to top |
|
 |
Digvijay Singh
New User
Joined: 20 Apr 2022 Posts: 99 Location: India
|
|
|
|
Code: |
I used that but getting below error
FINDREP=(INOUT=(C'RC=0000',C'RC=0012 JCK'),SHIFT=YES))
END
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER276B SYSDIAG= 525179, 12031906, 12031906, 14786190
WER164B 6,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 2,348K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER073I SORTIN : DSNAME=QSYS.SORT.RC.CODE
WER257I INREC RECORD LENGTH = 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER074I SORTOUT : DSNAME=QSYS.SORT.RC.CODE.OUT
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,204K BYTES USED
WER439A INREC FIND/REPLACE OVERRUN OF 80 BYTE RECORD LENGTH
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************** END OF DATA *********************************[code][/code] |
I feel it is bcz the replacing character has more size than the existing one..but i want to include the JCk at the end how i can do that any clue? |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
Increase LRECL of the input DSN to hold all data after the change. See:
Code: |
WER439A INREC FIND/REPLACE OVERRUN OF 80 BYTE RECORD LENGTH |
You might also add OVERRUN=TRUNC parameter, but I would rather check why the length goes beyond the LRECL. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
Consider posting in the right forum thread. You have SYNCSORT, this is for DFSORT topics. Thanks!
Good luck with fixing your obvious simple issue. |
|
Back to top |
|
 |
Digvijay Singh
New User
Joined: 20 Apr 2022 Posts: 99 Location: India
|
|
|
|
I also forgot to mention that IF RC=0008 then also that string should be replaced by RC=0008 JCk
I am able to replace RC=0000 with RC=0012 but my requirement has bit changed. like IF sortin file has Either RC=0000 and RC=0008 it should be replaced by RC=0012 JCK. How i can include multiple condition in FINDREP, I HAVE USED BELOW SORT CARD BUT GETTING SAME ERROR
Code: |
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=COPY
INREC FINDREP=(IN=(C'0008',C'0000'),OUT=C'0012 JCK')
/*
**************************** Bottom of Da |
ta ************* |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
Look up FINDREP in the manual, don't expect me to do your job. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1884 Location: USA
|
|
|
|
Digvijay Singh wrote: |
I used that but getting below error <--- this line is not a part of your code
Code: |
FINDREP=(INOUT=(C'RC=0000',C'RC=0012 JCK'),SHIFT=YES))
END
. . . . . . . . . .
WER439A INREC FIND/REPLACE OVERRUN OF 80 BYTE RECORD LENGTH
|
I feel it is bcz the replacing character has more size than the existing one..but i want to include the JCk at the end how i can do that any clue? |
Please, RTFM (at least once):
Quote: |
WER439A {INREC, OUTREC, ddname} FIND/REPLACE OVERRUN OF nnnnn BYTE RECORD LENGTH
EXPLANATION: FINDREP was used on either an INREC, OUTREC,
or OUTFIL ddname statement. The substitution of an output constant
during a FINDREP operation caused a non-blank character to be
pushed beyond the maximum record length. By default only trailing
blanks can be deleted during a FINDREP operation. nnnnn represents
the maximum record length for the FINDREP operation.
ACTION: Either specify a MAXLEN value on the FINDREP parameter
to increase the maximum length of the record or specify the
OVERRUN=TRUNC FINDREP subparameter to allow deletion of non-blank
characters. |
|
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1138 Location: Bamberg, Germany
|
|
|
|
Using
Code: |
INREC FINDREP=(IN=(C'0008',C'0000'),OUT=C'0012 JCK') |
may lead to false results when Job number or Msg Id contains these IN characters. |
|
Back to top |
|
 |
Digvijay Singh
New User
Joined: 20 Apr 2022 Posts: 99 Location: India
|
|
|
|
Thanks for replies.
I am still stuck here getting same error. i just want to append that JCk at the end of record. It seem if we use FINDREP we can't replace a smaller string with bigger string.
@Joerg
I ddin't get you ..i wantedly want to change the RC code from 0000 or 0008 to RC=0012 |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 1884 Location: USA
|
|
|
|
This forum is in English.
The documentation on SYNCSORT is also in English.
The official SYNCSORT manual is saying clearly and detailed:
Quote: |
WER439A {INREC, OUTREC, ddname} FIND/REPLACE OVERRUN OF nnnnn BYTE RECORD LENGTH
EXPLANATION: FINDREP was used on either an INREC, OUTREC,
or OUTFIL ddname statement. The substitution of an output constant
during a FINDREP operation caused a non-blank character to be
pushed beyond the maximum record length. By default only trailing
blanks can be deleted during a FINDREP operation. nnnnn represents
the maximum record length for the FINDREP operation.
ACTION: Either specify a MAXLEN value on the FINDREP parameter
to increase the maximum length of the record or specify the
OVERRUN=TRUNC FINDREP subparameter to allow deletion of non-blank
characters. |
Everything we can say is exactly the same English sentence. Of course I can translate it into two other languages, but I'm not sure: would it help? |
|
Back to top |
|
 |
|