Need solution by using OUTFIL OUTREC options



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need solution by using OUTFIL OUTREC options

Postby mohdmustafa__m » Fri Nov 29, 2013 5:26 am

Hi,
i tried to find some date manipulations using OUTFIL as below. My requirement is display 3 date formats from input file.
ie.. if my input date 11/12/2013 then my output should be as below:
11/12/2013 11122013(reformatted date) 20131122(added 10 days)
I need to use the reformatted date values of OUTFIL BUILD in OUTREC. i got spaces for those location.
Please suggest some solutions..
Here is my code i tried..
INPUT :
//SORTIN    DD *                                       
ABCDEF11/12/2013NOUSE TRYAGAIN                   
//SORTOUT   DD SYSOUT=*                                 
//SYSIN     DD *                                       
 SORT FIELDS=COPY                                     
    OUTFIL BUILD=(1:7,10,21:7,2,23:10,2,25:13,4)   
     OUTFIL OUTREC=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T)                           
//SYSOUT   DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*                                 
//SYSUDUMP DD SYSOUT=D       


OUTPUT : (b - blank)
1234567890123456789012345678901234567890123456789012345678901234567890---> cols
11/12/2013                 11122013                bbbbbbbb


Code'd
mohdmustafa__m
 
Posts: 6
Joined: Tue Nov 26, 2013 8:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need solution by using OUTFIL OUTREC options

 

Re: Need solution by using OUTFIL OUTREC options

Postby BillyBoyo » Fri Nov 29, 2013 2:36 pm

OUTFIL BUILD and OUTFIL OUTREC are just two ways of spelling the same thing. The BUILD spelling is more recent.

Your second OUTFIL is just being ignored.

Try this, but work on the problem it gives you before just posting here. Let us know the resolution if you get it, or what you did if you get stuck:

 SORT FIELDS=COPY                                     
    OUTFIL BUILD=(1:7,10,21:7,2,23:10,2,25:13,4, 
                    31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need solution by using OUTFIL OUTREC options

Postby NicC » Fri Nov 29, 2013 3:04 pm

Please note that OUTREC and OUTFIL are not JCL statements but sort control statements. This is being moved to the DFSort part of the forum. If you use Syncsort please advise and it will be moved there.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Need solution by using OUTFIL OUTREC options

Postby mohdmustafa__m » Sun Dec 01, 2013 10:53 pm

Hi BillyBoyo,
Regarding the solution you gave, the values are taken from SORTIN. I need to taken from intermediate values.
ie. My input : 11/12/2013
Intermediate value (after OUTFIL BUILD statement) : 11122013
Final Output : 20131122
For this i used OUTREC statement next to OUTFIL. Hope you understand my requirement.
mohdmustafa__m
 
Posts: 6
Joined: Tue Nov 26, 2013 8:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need solution by using OUTFIL OUTREC options

Postby BillyBoyo » Mon Dec 02, 2013 5:15 am

OK, Y4W for your case needs to be eight bytes, and your input data is not in the correct format for that.

First, understand that you second OUTFIL was completely ignored.

You need to do two operations: a BUILD; then another BUILD, or an OVERLAY.

Both BUILD and OVERLAY are valid for INREC, OUTREC and OUTFIL.

You can't have both a plain BUILD and a plain OVERLAY on the same statement, but you can have multiple IFTHENs.

That gives you many ways to do it, depending on what else (if anything) you are doing.

If you need OUTFIL, try:

  OPTION COPY
  OUTFIL IFTHEN=(WHEN=INIT,
                  BUILD=(1:7,10,21:7,2,23:10,2,25:13,4,31:10X)),
         IFTHEN=(WHEN=INIT,
                  OVERLAY=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T))


If you don't need OUTFIL, replace by INREC.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need solution by using OUTFIL OUTREC options

Postby skolusu » Tue Dec 03, 2013 12:57 am

use the following DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
----+----1----+----2----+----3----+----4----+----5----
ABCDEF11/12/2013NOUSE TRYAGAIN                       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  OPTION COPY                                         
  INREC BUILD=(7,10,21:7,10,UFF,M11,LENGTH=8)         
  OUTREC OVERLAY=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T)
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Need solution by using OUTFIL OUTREC options

Postby mohdmustafa__m » Tue Dec 03, 2013 11:10 pm

Hi Bill/Skolusu,
Thanks a lot. Both codes worked fine. Now i trying to do the same with file access. From VB format to FB, but got struck. Here is my code and abend details.
//PSTY0010 EXEC PGM=SORT,                                           
//             PARM='RC16=ABE'                                     
//SORTIN    DD DSN=FILE.VB,DISP=SHR      -> VB File
//SORTOUT   DD DSN=TEST.FBOUT,          -> FB File
//        DISP=(NEW,CATALG,DELETE),
//             DCB=(RECFM=FB,LRECL=60)                                       
//SYSIN     DD *                                                   
   SORT FIELDS=COPY                                                 
     OUTFIL IFTHEN=(WHEN=INIT,                                     
              BUILD=(1:7,10,21:7,2,23:10,2,25:13,4,31:10X,51:C'X')),
            IFTHEN=(WHEN=INIT,                                     
              OVERLAY=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T))         
//SYSOUT   DD SYSOUT=*                                             
//SYSPRINT DD SYSOUT=*                                             
//SYSUDUMP DD SYSOUT=D                                                                               

# 1st Issue :
Getting Error Message as : (while using VB to FB )
ICE150I 1 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE251A 9 MISSING RDW OR DATA FOR SORTOUT : REASON CODE 03, IFTHEN 1

# 2nd Issue :
OVERLAY=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T)),VTOF

Getting Error Message as : (while using VTOF)
ICE150I 1 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 05, IFTHEN 1

While using file oriented modifications, i'm getting these error codes as follows :
0251
0043
0126
Can some one help me regarding this.

Skolusu,
May i know what exactly the below code does:
INREC BUILD=(7,10,21:7,10,UFF,M11,LENGTH=8)

UFF is for reformatting but how it identifies the char '/' in it?
mohdmustafa__m
 
Posts: 6
Joined: Tue Nov 26, 2013 8:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need solution by using OUTFIL OUTREC options

Postby skolusu » Wed Dec 04, 2013 4:44 am

mohdmustafa__m,

Did you look up the error message ICE251A? With VB files you need to remember that the first data byte starts in position 5 after the RDW in positions 1-4. So Unless you are converting the VB file to an FB file you need to code the RDW

here is a link for explanation of the error message ICE251A

http://publibz.boulder.ibm.com/cgi-bin/ ... 60/2.2.237?

Check this link which explains in detail about UFF/SFF format
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Need solution by using OUTFIL OUTREC options

Postby BillyBoyo » Wed Dec 04, 2013 4:50 am

And to code the conversion from V to F you need to specify VTOF on OUTFIL.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Need solution by using OUTFIL OUTREC options

Postby mohdmustafa__m » Thu Dec 05, 2013 9:17 am

Yes you are rite. But I tried with the input file as "AB11/12/2013CHECK OUTFIL". So i took the 7th char in BUILD operand. Also i used the VTOF in BUILD operand. Still i'm facing the issue as "ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 05, IFTHEN 1" when converting VB to FB.
Code :
SORT FIELDS=COPY                                                 
     OUTFIL IFTHEN=(WHEN=INIT,                                     
              BUILD=(1:7,10,21:7,2,23:10,2,25:13,4,31:10X,51:C'X'),VTOF),
            IFTHEN=(WHEN=INIT,                                     
              OVERLAY=(31:21,8,Y4W,ADDDAYS,+10,TOGREG=Y4T))


Same code i tried with FB to FB its working(without VTOF). Its not working with VB to FB format, since VTOF is not supported in IFTHEN operand.
Thanks for the links and got the meaning of ICE0126A abend.
mohdmustafa__m
 
Posts: 6
Joined: Tue Nov 26, 2013 8:42 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post