Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort and Compare Lengthy files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2012 11:07 am    Post subject: Sort and Compare Lengthy files
Reply with quote

Hi,

I have 2 files, Both the files are 390 Record length(FB).
I need to compare both the files using SORT for full length(390).

While doing the compare on full length(390), am getting the error "INVALID FIELDS OR CONSTANT IN SORTOF01 IFTHEN 0 CONDITION 1"

Only one step is there in the JCL, No IF/THEN used in the JCL.

Can you please help me out to fix this issue.

Regards,
Vasantha GL
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Apr 09, 2012 12:08 pm    Post subject:
Reply with quote

Hi,

please show the JCL and all of the output including messages.


Gerry
Back to top
View user's profile Send private message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2012 12:13 pm    Post subject: Reply to: Sort and Compare Lengthy files
Reply with quote

Please find below for JCL and Error Message in Sysout
JCL

Code:
000018 //SPLIT002 EXEC PGM=SORT                                             
000019 //*                                                                 
000020 //SORTJNF1 DD  DSN=Input file 1,DISP=SHR               
000021 //SORTJNF2 DD  DSN=Input file 2,DISP=SHR               
000022 //*                                                                 
000023 //SORTOF01 DD  DSN=output file 1,                       
000024 //             DISP=(NEW,CATLG,DELETE),                             
000025 //             DCB=(RECFM=FB,LRECL=390,BLKSIZE=0),                   
000026 //             SPACE=(CYL,(100,100),RLSE)                           
000027 //*                                                                 
000028 //SORTOF02 DD  DSN=output file 2,                   
000029 //             DISP=(NEW,CATLG,DELETE),                             
000030 //             DCB=(RECFM=FB,LRECL=390,BLKSIZE=0),                   
000031 //             SPACE=(CYL,(100,100),RLSE)                           
000032 //*                                                                 
000033 //SYSPRINT DD  SYSOUT=*                                             
000034 //SYSOUT   DD  SYSOUT=*                                             
000035 //SORTMSG  DD  SYSOUT=*                                             
000036 //*                                                                 
000037 //SYSIN DD *                                                         
000038   JOINKEYS FILE=F1,FIELDS=(1,390,A)                                 
000039   JOINKEYS FILE=F2,FIELDS=(1,390,A)                                 
000040   JOIN UNPAIRED,F1                               
000041   REFORMAT FIELDS=(F1:1,390,F2:1,390)           
000042   SORT FIELDS=COPY                               
000043                                                 
000044   OUTFIL FILES=01,                               
000045   INCLUDE=(1,390,CH,EQ,391,390,CH),             
000046   OUTREC=(1:1,390)                               
000047                                                 
000048   OUTFIL FILES=02,                               
000049   INCLUDE=(1,390,CH,NE,391,390,CH),             
000050   OUTREC=(1:1,390)                               
000051 //*                                             
 
 
ERROR MSG in SYSOUT
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 06:21 ON MON AP
            JOINKEYS FILE=F1,FIELDS=(1,390,A)                                   
            JOINKEYS FILE=F2,FIELDS=(1,390,A)                                   
            JOIN UNPAIRED,F1                                                   
            REFORMAT FIELDS=(F1:1,390,F2:1,390)                                 
            SORT FIELDS=COPY                                                   
                                                                               
            OUTFIL FILES=01,                                                   
            INCLUDE=(1,390,CH,EQ,391,390,CH),                                   
            OUTREC=(1:1,390)                                                   
                                                                               
            OUTFIL FILES=02,                                                   
            INCLUDE=(1,390,CH,NE,391,390,CH),                                   
            OUTREC=(1:1,390)                                                   
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2                 
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=780                             
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                   
ICE221A 1 INVALID FIELD OR CONSTANT IN SORTOF01 IFTHEN 0 CONDITION 1     
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 E9-K60823 E7-K62201   
ICE052I 3 END OF DFSORT
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Apr 09, 2012 12:30 pm    Post subject: Re: Reply to: Sort and Compare Lengthy files
Reply with quote

DFSORT gives you a marker coming out of the join, which you can use rather than matching the whole record a 2nd and a 3rd time.


Code:
   REFORMAT FIELDS=(F1:1,390,F2:1,390,?)           

   OUTFIL FILES=01,                               
   INCLUDE=(781,1,CH,EQ,C'B'),             
   OUTREC=(1:1,390)                               
                                                 
   OUTFIL FILES=02,                               
   INCLUDE=(781,1,CH,EQ,C'1'),             
   OUTREC=(1:1,390)                               
Back to top
View user's profile Send private message
vasantha.gl

New User


Joined: 23 Sep 2011
Posts: 12
Location: Chennai

PostPosted: Mon Apr 09, 2012 12:42 pm    Post subject: Reply to: Sort and Compare Lengthy files
Reply with quote

Thanks a Lot.

This is Working fine ..

One doubt -
DFSORT don't support whole length Compare???
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Apr 09, 2012 1:32 pm    Post subject: Reply to: Sort and Compare Lengthy files
Reply with quote

No problem.

You should do a little research (look at the manual, link at the top of the page or the "sticky"s in this forum) yourself.

Of course DFSORT can compare 390 bytes, and much more.

If both records had been present (matched on the "key", of 390 bytes) then there would definitely not have been a problem with what you were doing.

With a situation where one or the other record may not be there, in DFSORT I'd use the marker (1/2/B) to tell me which record(s) I have a the time.

Also, try to work out exactly what the error message was telling you.

If you check back later (working hours San Jose time) you can confirm that your research is correct.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Apr 09, 2012 2:55 pm    Post subject:
Reply with quote

Hi,

I think the problem here is that you cannot compare more than 256 bytes at a time.

Bill's solution is simpler but this should also work
Code:
  JOINKEYS FILE=F1,FIELDS=(1,390,A)           
  JOINKEYS FILE=F2,FIELDS=(1,390,A)           
  JOIN UNPAIRED,F1                             
  REFORMAT FIELDS=(F1:1,390,F2:1,390)         
  SORT FIELDS=COPY                             
                                               
  OUTFIL FILES=01,                             
  INCLUDE=(001,256,CH,EQ,391,256,CH,&,         
           257,134,CH,EQ,647,134,CH)           
                                               
  OUTFIL FILES=02,                             
  INCLUDE=(001,256,CH,NE,391,256,CH,OR,       
           257,134,CH,NE,647,134,CH)           



Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Apr 09, 2012 3:16 pm    Post subject: Reply to: Sort and Compare Lengthy files
Reply with quote

I missed the 256 thing.

The 390-byte compare (and longer is possible) has been done on the JOINKEYS, up to 4080 (note to self on that one).

Where wanting X and NOT-X or X, Y, Z and The Rest, SAVE I think is better. You don't have to repeat and negate, so less easy to introduce errors (only possible error is in the original).
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Apr 09, 2012 3:16 pm    Post subject:
Reply with quote

Hi,

I just realised that I left off the OUTREC statement
Code:
  OUTFIL FILES=01,                               
  INCLUDE=(001,256,CH,EQ,391,256,CH,&,           
           257,134,CH,EQ,647,134,CH),           
           OUTREC=(1:1,390)                     
                                                 
  OUTFIL FILES=02,                               
  INCLUDE=(001,256,CH,NE,391,256,CH,OR,         
           257,134,CH,NE,647,134,CH),           
           OUTREC=(1:1,390)                     


or this
Code:
  OUTFIL FILES=01,                                 
  INCLUDE=(001,256,CH,EQ,391,256,CH,&,             
           257,134,CH,EQ,647,134,CH),               
           OUTREC=(1:1,390)                         
                                                   
  OUTFIL FNAMES=SORTOF02,SAVE,                     
           OUTREC=(1:1,390)                         



Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Apr 09, 2012 10:45 pm    Post subject:
Reply with quote

Sometimes I wonder why I spend so much time working on the DFSORT books considering that people don't seem to be willing to use them. If you look up the ICE221A message, the Explanation says:

One of the following errors was detected:
* the length for a field with a format other than SS was greater than 256
...

CH is NOT SS so what is unclear about that?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 09, 2012 11:44 pm    Post subject: Reply to: Sort and Compare Lengthy files
Reply with quote

Hi Frank,

Quote:
Sometimes I wonder why I spend so much time working on the DFSORT books considering that people don't seem to be willing to use them.
I suspect that what we see here is the smaller group of people that do not know how (or care to learn) how to use manuals.

From my experience in many, many data centers, the "good" analysts use the manuals (many have downloaded a local copy and/or bookmarked them) extensively. These folks (and I) greatly appreciate the effort put into these documents icon_exclaim.gif

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Apr 10, 2012 12:01 am    Post subject:
Reply with quote

You're probably right, Dick. Thanks for the encouraging words.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Apr 10, 2012 12:49 am    Post subject:
Reply with quote

Quote:
I suspect that what we see here is the smaller group of people that do not know how (or care to learn) how to use manuals.


Many of the TS on this forum have been conditioned to put out meager specs and have complete solutions handed to them.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Apr 10, 2012 1:24 am    Post subject:
Reply with quote

Meager specs are usually met on this Forum with lots of questions about what the poster really wants to do, requests for good examples and descriptions of the rules, more information, etc. I have no problem with providing DFSORT/ICETOOL solutions to people (I know some people don't share that view), but I do require that they make it clear what exactly they want a solution to.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us