Page 2 of 2

Re: To retrieve the output like this using SORT

PostPosted: Tue Jul 29, 2014 7:11 pm
by Daouchiche
Trying this but still giving me an S322

Re: To retrieve the output like this using SORT

PostPosted: Tue Jul 29, 2014 7:18 pm
by Daouchiche
This gave me an ABENDS322.

Re: To retrieve the output like this using SORT

PostPosted: Tue Jul 29, 2014 7:48 pm
by Daouchiche
Well I use more time and the job was fine but gives no result.

Re: To retrieve the output like this using SORT

PostPosted: Tue Jul 29, 2014 8:51 pm
by BillyBoyo
More CPU time will be used because you can't check across two separate records on INCLUDE COND=/OMIT COND=. So every record on you file has to be tested.

You should do your testing with a small file. Check the condition that you have given. If you still have a problem, show the input with HEX ON for the record and show the control cards that you are using.

Re: To retrieve the output like this using SORT

PostPosted: Wed Jul 30, 2014 1:02 am
by Daouchiche
Her is the input hex on :
----+----1----+----2----+----3----+----4
  }     783091                         
00D10100FFFFFF44444444444444444444444444
0100000178309100000000000000000000000000
----------------------------------------
  }  )  É"  È testR420AL300110Y    j   Y
00D20513770173A8AADFFFCDFFFFFFE00009000E
010E3D101F144F352394201330011080000100F8
----------------------------------------
  }     126061                         
00D10100FFFFFF44444444444444444444444444
0100000112606100000000000000000000000000
----------------------------------------
  }  )  É"  È testR420AL300110Y    j   Y
00D20513770173A8AADFFFCDFFFFFFE00009000E
010E3D101F144F352394201330011080000100F8
----------------------------------------
  }     881309                         
00D10100FFFFFF44444444444444444444444444
----------------------------------------

Here is to job :

//SIDEV01I JOB (0000,0000,0000),'ICETOOL TEST',             
//        NOTIFY=SIDEV01,MSGCLASS=Q,MSGLEVEL=(1,1),CLASS=X 
/*JOBPARM M=4096,T=199,L=99,R=CDT                           
//*                                                         
//STEP1 EXEC PGM=ICETOOL                                   
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN      DD DSN=FILEIN.SMALL,DISP=SHR                     
//OUT     DD DSN=FILEOUT.....,DISP=SHR                     
//*                                                         
//TOOLIN DD *                                               
COPY FROM(IN) TO(OUT) USING(CTL1)                           
//CTL1CNTL DD *                                             
 INREC IFTHEN=(WHEN=INIT,                                   
                  BUILD=(1,4,X,5)),                         
       IFTHEN=(WHEN=GROUP,BEGIN=(5,4,BI,EQ,X'0001D010',     
                                 AND,13,10,CH,EQ,C'126061'),
                          RECORDS=2,                       
                          PUSH=(5:2,1))                     
  OUTFIL OMIT=(5,1,CH,EQ,C' '),     
            BUILD=(1,5,6)                       

The result should be like :

----------------------------------------
  }     126061                         
00D10100FFFFFF44444444444444444444444444
0100000112606100000000000000000000000000
----------------------------------------
  }  )  É"  È testR420AL300110Y    j   Y
00D20513770173A8AADFFFCDFFFFFFE00009000E
010E3D101F144F352394201330011080000100F8
----------------------------------------


Coded

Re: To retrieve the output like this using SORT

PostPosted: Wed Jul 30, 2014 1:15 am
by Terry Heinze
As NicC suggested, "Also, please learn how to use the code tags for posting data, code etc."

Re: To retrieve the output like this using SORT

PostPosted: Wed Jul 30, 2014 2:57 am
by NicC
Agreed. Without coding the data is all over the place - coded it lines up nicely. Please use the "PostReply" button to post a reply not the quick reply and you will find using code tags a cinch. And remember to use the preview button before submittng to ensure that you have done it correctly. And remember, also, that you can edit your post immediately after hitting submit and that will also put you into the full editor.

Re: To retrieve the output like this using SORT

PostPosted: Wed Jul 30, 2014 7:03 pm
by Daouchiche
Thanks a lot. Now it work, here is the solution

INREC IFTHEN=(WHEN=GROUP,BEGIN=(5,4,BI,EQ,X'0001D010',     
                                AND,13,10,CH,EQ,C'123456'),
                         RECORDS=2,                       
                         PUSH=(870:13,6))                 
                                                           
OUTFIL INCLUDE=(870,6,CH,EQ,C'123456'),                   
   IFTHEN=(WHEN=(5,4,BI,EQ,X'0001D010'),BUILD=(1,4,5,14)),
   IFTHEN=(WHEN=(5,4,BI,EQ,X'0001D02E'),BUILD=(1,4,5,863))


Code'd

Re: To retrieve the output like this using SORT

PostPosted: Thu Jul 31, 2014 11:41 am
by BillyBoyo
That looks pretty good.

I'd consider PUSHing the 10 characters, just for flexibility.

Your second IFTEHN on OUTFIL you really want an "else". Try IFTHEN=(WHEN=NONE) which says "if none of the above conditions have been met (you happen to only have one condition above).

Just to note that normally a variable-length record is extended "at the front". You have made your variable-length selected records a fixed-length with 870:13,6. Your final main record may be much longer than you expect, padded with trailing space.