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

Need suggestion on a sort card


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 75
Location: India

PostPosted: Mon Sep 26, 2022 11:22 pm
Reply with quote

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]
Code:


Any small help or suggestion i am trying to but not getting all the content
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 900
Location: Bamberg, Germany

PostPosted: Mon Sep 26, 2022 11:45 pm
Reply with quote

Code:
OPTION COPY                                               
INREC IFTHEN=(WHEN=INIT,                                 
  FINDREP=(INOUT=(C' RC=0000',C' RC=0012 JCK'),SHIFT=YES))
END
Back to top
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 75
Location: India

PostPosted: Tue Sep 27, 2022 3:27 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 900
Location: Bamberg, Germany

PostPosted: Tue Sep 27, 2022 3:37 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 900
Location: Bamberg, Germany

PostPosted: Tue Sep 27, 2022 4:22 pm
Reply with quote

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
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 75
Location: India

PostPosted: Tue Sep 27, 2022 4:23 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 900
Location: Bamberg, Germany

PostPosted: Tue Sep 27, 2022 4:30 pm
Reply with quote

Look up FINDREP in the manual, don't expect me to do your job.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1612

PostPosted: Tue Sep 27, 2022 6:13 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 900
Location: Bamberg, Germany

PostPosted: Wed Sep 28, 2022 1:07 pm
Reply with quote

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
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 75
Location: India

PostPosted: Wed Sep 28, 2022 7:29 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1612

PostPosted: Wed Sep 28, 2022 8:40 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts SORT deletes the SORTOUT file DFSORT/ICETOOL 8
No new posts Creating CSV file from Variable recs ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top