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

Sort and Compare Lengthy files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Mon Apr 09, 2012 12:08 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 09, 2012 12:30 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 09, 2012 1:32 pm
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: 1702
Location: Australia

PostPosted: Mon Apr 09, 2012 2:55 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 09, 2012 3:16 pm
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: 1702
Location: Australia

PostPosted: Mon Apr 09, 2012 3:16 pm
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 Developer


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

PostPosted: Mon Apr 09, 2012 10:45 pm
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

Moderator Emeritus


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

PostPosted: Mon Apr 09, 2012 11:44 pm
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 Developer


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

PostPosted: Tue Apr 10, 2012 12:01 am
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: 792
Location: Pennsylvania

PostPosted: Tue Apr 10, 2012 12:49 am
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 Developer


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

PostPosted: Tue Apr 10, 2012 1:24 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top