Computing length of given PIC clause



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

Computing length of given PIC clause

Postby kamal » Fri Jun 27, 2008 3:17 pm

The requirement is like
PICTURE--    FLD  START     END  LENGTH
9(10)V9(10)    2     81      91      11

I want to find out such records from a long list given in above format,
for which the PIC length for 9(10)V9(10) ( 10 + 10 = 20 ) is greater than the value given in length column(11).
i.e. 20 > 11.

Can this be done using DFSORT ?
The Input list goes like:
PICTURE--    FLD  START     END  LENGTH
X(80)          1      1      80      80
9(10)V9(10)    2     81      91      11
X(4)           3     92      95       4
9(14)          4     96     109      14
9(4)           5    110     113       4
X(14)          6    114     127      14
9(8)           7    128     132       5


Out of these only rec 2 and 7 fit in the condition said above.
These records should be identified.
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Computing length of given PIC clause

 

Re: Computing length of given PIC clause

Postby Frank Yaeger » Fri Jun 27, 2008 8:57 pm

Is the header (PICTURE ...) actually in the input file?

What do you want the output to look like exactly?

What is the RECFM and LRECL of the input file.

Are there always either one "(x)' item or two '(x)' items in the PICTURE format
or are there other variations that might appear that you haven't mentioned (I don't know COBOL).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Computing length of given PIC clause

Postby kamal » Mon Jun 30, 2008 11:44 am

Input file Length 200 ;FB
Pic claused are always "(x)" /"(xx)" depending upon the length.
just the fileds should be identified.

Would be great if o/p format is same as i/p with a char 'Y' after three places of last char for identified records(using said condition(s)).Shown below:
PICTURE--    FLD  START     END  LENGTH
X(80)          1      1      80      80
9(10)V9(10)    2     81      91      11   Y
X(4)           3     92      95       4
9(14)          4     96     109      14
9(4)           5    110     113       4
X(14)          6    114     127      14
9(8)           7    128     132       5   Y
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Computing length of given PIC clause

Postby dick scherrer » Mon Jun 30, 2008 10:20 pm

Hello,

What about fields defined as 999 or 999v9 etc?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Computing length of given PIC clause

Postby skolusu » Tue Jul 01, 2008 2:11 am

The Following DFSORT JCL will give you the desired results. I just assumed that you only 2 fields definitions which are enclosed in parenthesis. If you have more than 2 we can adjust the job.

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
PICTURE--    FLD  START     END  LENGTH                     
X(80)          1      1      80      80                     
9(10)V9(10)    2     81      91      11                     
X(4)           3     92      95       4                     
9(14)          4     96     109      14                     
9(4)           5    110     113       4                     
X(14)          6    114     127      14                     
9(8)           7    128     132       5                     
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION SKIPREC=1                                         
  SORT FIELDS=COPY                                         
  INREC PARSE(%00=(STARTAFT=C'(',ENDBEFR=C')',FIXLEN=5),   
              %01=(STARTAFT=C'(',ENDBEFR=C')',FIXLEN=5)),   
            OVERLAY=(201:%00,UFF,EDIT=(TTTTT),             
                         %01,UFF,EDIT=(TTTTT),             
                         201,5,ZD,ADD,206,5,ZD,EDIT=(TTTTT),
                         35,5,UFF,EDIT=(TTTTT))             
  OUTREC IFOUTLEN=200,                                     
  IFTHEN=(WHEN=(211,5,ZD,NE,216,5,ZD),OVERLAY=(45:C'Y'))   
//*                                                         


Hope this helps...

Cheers
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: Computing length of given PIC clause

Postby kamal » Tue Jul 01, 2008 5:51 pm

What about fields defined as 999 or 999v9 etc?

dick scherrer this situation won't be there

Pic claused are always "(x)" /"(xx)" depending upon the length.

so it will be 9(3) or 9(3)v9(1)
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Computing length of given PIC clause

Postby dick scherrer » Tue Jul 01, 2008 8:14 pm

Hello,

Then you should be "good to go" :)

Thanks for letting us know.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post