Not able to do a Numeric check using sort.

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Rinil T
Member
Posts: 5
Joined: Tue Jul 08, 2014 8:30 pm
Location: Mumbai

Not able to do a Numeric check using sort.

Post by Rinil T » Thu Sep 11, 2014 8:24 pm

Hi,

I require Urgent quick help on below issue:
I want to check for numeric data at 148th position of the file for 2 byte field.
Input file:
COLS> ---4----+----5----+
00001 006102LMADPB
00002 006102LMADPB
00003 006102LMADPB
00004 006102LIT2PB
00005 0061LMADPB 0
00006 0061LMADPB 0

Like the last 2 recs should not be present in the output file. I coded a sort card given below:

//STEP001 EXEC PGM=SORT,REGION=4M
//SORTIN DD DSN=BCST.R554268.ACCOUNTS.TEST1,DISP=SHR
//OUT1 DD DSN=BCST.R554268.OPV,
// UNIT=SYSDA,DISP=(NEW,CATLG,DELETE),
// DCB=(*.SORTIN),SPACE=(CYL,(10,10),RLSE)
//OUT2 DD DSN=BCST.R554268.OPN,
// UNIT=SYSDA,DISP=(NEW,CATLG,DELETE),
// DCB=(*.SORTIN),SPACE=(CYL,(10,10),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,INCLUDE=(148,2,FS,EQ,NUM)
OUTFIL FNAMES=OUT2,INCLUDE=(148,2,FS,NE,NUM)
//*


but this is not giving me correct results, i am getting all the recs in 1st output file.

I am getting following msg in SYSOUT.

SYSIN :
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,INCLUDE=(148,2,SS,EQ,NUM)
*
OUTFIL FNAMES=OUT2,INCLUDE=(148,2,SS,NE,NUM)
*
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER253A INCLUDE/OMIT FORMATS INCOMPATIBLE
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


If this version of DFSORT is not compatible, then Is there any other way with which i can achieve the situation.

Any help will be really appreciated.

Thanks,
RinilImageImage

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Thu Sep 11, 2014 8:56 pm

If you waqnt urgent hep then a forum is not the place to ask - ask your colleagues. People on forums answer for free, in their own time, if they feel so inclined. I believe most forum rules say that you should avoid posting urgent/asap or whatever. Some people refuse to answer , or deliberatly de;ay answering, when such posts are made.
Regards
Nic

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Sep 15, 2014 7:06 pm

this is a syncsort problem. wer messages are syncsort.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Sep 15, 2014 8:02 pm

Hi Dick - just to confuse us, on this forum DFSort/ICETool also handle the Syncsort equivalents. No wonder some people get confused!
Regards
Nic

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Tue Sep 16, 2014 2:19 pm

Seems that, your data in the 149th position is SPACE in all the records.? Not sure that caused the records directed to the same outfil.

Code: Select all

COLS> ---4----+----5----+ 
00001 006102LMADPB 
00002 006102LMADPB 
00003 006102LMADPB 
00004 006102LIT2PB 
00005 0061LMADPB 0 
00006 0061LMADPB 0 
Please use the CODE tag for projecting your questions better.

Also I have tried it in DFSort and the same was working fine.

Code: Select all

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000010 //SORT1    EXEC PGM=SORT,COND=(4,LE)                                    
000011 //SORTIN   DD  *                                                        
000012 GURUMOORTHYAA                                                           
000013 GURUMOORTHYAA                                                           
000014 GURUMOORTHY22                                                           
000015 GURUMOORTHY01                                                           
000016 GURUMOORTHY1                                                            
000017 GURUMOORTHYB1                                                           
000018 //OUTFILE1 DD  SYSOUT=*                                                 
000019 //OUTFILE2 DD  SYSOUT=*                                                 
000020 //SORTOUT  DD  SYSOUT=*                                                 
000021 //SYSIN    DD  *                                                        
000022   OPTION COPY                                                           
000023   OUTFIL FNAMES=OUTFILE1,INCLUDE=(12,2,FS,EQ,NUM)                       
000024   OUTFIL FNAMES=OUTFILE2,INCLUDE=(12,2,FS,NE,NUM)                       
000025 /*                                                                      
000026 //SYSOUT   DD  SYSOUT=*                                                 

OUTFILE1

Code: Select all

********************************* TOP OF DATA **********************************
GURUMOORTHY22                                                                   
GURUMOORTHY01                                                                   
******************************** BOTTOM OF DATA ********************************
OUTFILE2

Code: Select all

********************************* TOP OF DATA **********************************
GURUMOORTHYAA                                                                   
GURUMOORTHYAA                                                                   
GURUMOORTHY1                                                                    
GURUMOORTHYB1                                                                   
******************************** BOTTOM OF DATA ********************************
Guru:-)

You're never fully dressed without a smile :)

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Sep 17, 2014 6:01 pm

Control cards shown are not those which caused the error messages, which show a field-type of SS, for which NUM is not possible.

As Gurugars has shown, I don't see why those control cards would not give you what you want. Since you have mutual exclusion, I'd code the second OUTFIL as SAVE rather than do it by negating the test.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others