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

Help on SORT Logic.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 2:13 pm
Reply with quote

Hi
I have a input fie of 104 length file.

Code:
01  EMP-REC.                                             
     10 EMP-KEY                         PIC X(10).       
     10 EMP-NAME                        PIC X(30).       
     10 EMP-DESIGN.                                     
        49 EMP-DESIGN-LEN               PIC S9(4) COMP. 
        49 EMP-DESIGN-TEXT              PIC X(20).       
     10 EMP-ADDRESS.                                     
        49 EMP-ADDRESS-LEN              PIC S9(4) COMP. 
        49 EMP-ADDRESS-TEXT             PIC X(30).       
     10 EMP-SALARY                      PIC 9(10).       


I will be getting data in this format. But its not necessary that fields will contain full according to their length. Like Emp-key is of 10 byte but it can contain of 5 bytes data. So i need to write a sort card which will concatenate all fields in output file by '|' (pipe) and based on their data length output files' length must also vary. But it wont be greater than 104.
i.e
EMP-KEY(10)|EMP-NAME(30)|EMP-DESIGN-TEXT(20)|EMP-ADDRESS-TEXT(30)|EMP-SALARY

Also I hv to do vice-varsa.
I will be gettin file in above format of output file. So I need to write a sort card which will create file similart to the above input file containing LEN as well.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Mar 21, 2012 2:28 pm
Reply with quote

You are totally clueless, aren't you?

Is EMP-KEY is defined as PIC X(10), it will contain 10 bytes of data. No more, no less!
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: Wed Mar 21, 2012 2:32 pm
Reply with quote

What is in the "trailing" part of each field you want to chop? Do you have embedded spaces in names, or anything?

On the way "out" are you ignoring the binary fields, or would you prefer to use them to determine the lengths?

On the way "in" would you like the binary fields to be correct, or zero?

EDIT: We can assume that you meant "n bytes of data and 10-n bytes of "stuff" that you don't want on the Pipe file, but which you realise is convenient to have normally".
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 2:44 pm
Reply with quote

Hi Prino,

I mean,
If EMP-KEY(10) will contain 5 bytes data+5 trailing spaces then i want to ignore them and just want to concatenate 5 bytes of actual data.

Bill, I dont want to write binary fields in output but yes how it can be used in sort so that actual data(not trailing spaces) can be incuded in output.

Similary when i will receive a file which will contain '|' then at tht time i need to write the binary fields also in output which will contain the length.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 21, 2012 3:03 pm
Reply with quote

Ashutosh,
if the field length is zero, assume you want the data value expressed as ||


Forum Members,
word to the wise,
this poster has a habit of starting threads and then never coming back.
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 3:10 pm
Reply with quote

Hi Dick
Yes if the fields length will be zero then data value will be ||.

But Sorry
I didnt get you.. If you have provided a solution for a topic started by me and if it worked for me then what is point in coming back.
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: Wed Mar 21, 2012 3:20 pm
Reply with quote

apandey wrote:
[...]
But Sorry
I didnt get you.. If you have provided a solution for a topic started by me and if it worked for me then what is point in coming back.


Politeness, grace, good manners, information (knowing the solution works), feelings of warmth to the whole of humanity... etc
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 3:29 pm
Reply with quote

I hope i hv done tht Bill...if you remeber my last post in cobol section few days back...!
And If you guys still think so, then sorry for tht. Will keep in mind. Thanks for informing icon_smile.gif

But I am still not able to sort out my issue.
I am not able to find the solution coz of Length.
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: Wed Mar 21, 2012 3:33 pm
Reply with quote

It was you who said "what is the point"? :-)

I just answered, I didn't check through your posting history, since you were so unconcerned about it....
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 3:56 pm
Reply with quote

Hi All

I have tried thru OUTREC giving C'|' in it but file is coming as fixed block and with spaces as below:
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6---
****** ***************************** Top of Data *********************
000001 100       |RAHUL KUMAR                   |IT ANALYST          |
000002 15489     |JOHN SMIT                     |PROJECT MANAGER     |
000003 366537    |BIMAL ROY SEN                 |SOFTWARE DEVELOPER  |
****** **************************** Bottom of Data *******************
                                                                     


Is there any way thru which the Trailing spaces can be removed thru SORT.
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: Wed Mar 21, 2012 4:05 pm
Reply with quote

You would need to put "something" around the fields which can contain embedded blanks, and SQZ the record checking on the processing of QUOTE/APOST. Then convert it to variable-length.

Watch out for the possibility of your delimeter appearing in your data. Maybe to FINDREP to something like X'FF' and then reverse it after the SQZ.

The binary fields on the way back are trickier. It would be best to use the binary fields on the way out, but I'm not sure how :-)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 21, 2012 4:05 pm
Reply with quote

Ashutosh,

you spend a lot of time (and space) defending yourself,
but you never supply any of the info asked for.

and what i was referring to was threads started by you,
questions asked in order to create a solution for you,
that you never answer, and the thread dies.

but i digress,

you want:
EMP-KEY(10)|EMP-NAME(30)|EMP-DESIGN-TEXT(20)|EMP-ADDRESS-TEXT(30)|EMP-SALARY
but spaces on the right truncated?
EMP-SALARY will always be 10 char numeric?
will this be generated as a Variable record file or Fixed length (104) record file?


as well as the converse?

again, answer the question of variable length and/or fixed length.

EMP-KEY|EMP-NAME|EMP-DESIGN-TEXT|EMP-ADDRESS-TEXT|EMP-SALARY
EMP-KEY expanded to 10
EMP-NAME expanded to 30
EMP-DESIGN-LEN generated as 2 bytes binary reflecting the length of data between the two | bounding EMP-DESIGN-TEXT
EMP-DESIGN-TEXT expanded to 20
EMP-ADDRESS-LEN generated as 2 bytes binary reflecting the length of data between the two | bounding EMP-ADDRESS-TEXT
EMP-ADDRESS-TEXT expanded to 30
EMP-SALARY copied as the 10 char

and this is to be generated as a 104 byte record
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 4:29 pm
Reply with quote

Bill, Sorry I dont know abt SQZ icon_sad.gif

Dick,
As mentioned by you, yes I need my output as:
EMP-KEY(10)|EMP-NAME(30)|EMP-DESIGN-TEXT(20)|EMP-ADDRESS-TEXT(30)|EMP-SALARY
But the fields shudn't contain trailing spaces.
YES, EMP-SALARY will always contain 10 digit numeric data.
Output File can be created in VB with 104 length.
Say if all fields contain full data without spaces then whole 104 lenth would be full. If all length fields data without spaces + 4 pipes(|) is less than 104 then remaining positions after last field(EMP-SALARY) can be filled with spaces.

While for Vice versa
It will be other way round.
Either a field contains spaces or not it shud be included till its exact length.
Ex. EMP-KEY(10) contains 5 bytes data but next field shud be written from 11th position.
LEN field will contain the length of field containing actual data without spaces. EMP-ADDRESS-TEXT(30) contains 15 bytes data then LEN will be 15.
RECFM will be FB with LRECL of 104.
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: Wed Mar 21, 2012 4:34 pm
Reply with quote

Link to the manuals at the top of the page.
Back to top
View user's profile Send private message
Nikhil Jain

New User


Joined: 20 Jul 2011
Posts: 16
Location: India

PostPosted: Wed Mar 21, 2012 4:57 pm
Reply with quote

While, you are rading the manual, you might want to have a look at the PARSE also.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 21, 2012 5:06 pm
Reply with quote

Quote:
Output File can be created in VB with 104 length.
Say if all fields contain full data without spaces then whole 104 lenth would be full. If all length fields data without spaces + 4 pipes(|) is less than 104 then remaining positions after last field(EMP-SALARY) can be filled with spaces.


that means you want a fixed length output.....................................................
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Wed Mar 21, 2012 5:27 pm
Reply with quote

Ashutosh,

have a look at smart DFSORT tricks document. Refer to "deconstrcut and reconstruct CSV records" section. it is a very good starting point for your requirement.

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf

Regards,
Charan
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Mar 21, 2012 5:51 pm
Reply with quote

Hi Charan
Sorry above link is not working 'Internet Explorer cannot display the webpage' is the msg i am getting. I think it is blocked here.

Yes Dick, it will be FB file.
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: Wed Mar 21, 2012 6:03 pm
Reply with quote

If you can access this site, maybe you might think the "ftp" bit is tripping you up?

How about google? DFSORT Manuals got me this.

You are making things hard for yourself by not doing much to help yourself. Also search this forum, you'll find lots of SQZ and PARSE and JUSTIFY and stuff.
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: Wed Mar 21, 2012 6:13 pm
Reply with quote

There's even a link from a STICKY at the top of each page of the DFSORT forum where you have posted.
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: Thu Mar 22, 2012 3:37 am
Reply with quote

Ashutosh,

For your first requirement, you can try a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/104)
//SORTOUT DD DSN=...  output file (FB/104)
//SYSIN DD *
  OPTION COPY
  INREC IFOUTLEN=104,
        IFTHEN=(WHEN=INIT,
        BUILD=(1,10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=12),
              11,30,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=32),
              43,20,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=22),
              65,30,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=32),
              C'"',95,10,C'"')),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,108,SQZ=(SHIFT=LEFT,PAIR=QUOTE))),
    IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'""',C'|',C'"',C'')))
/*


Your second requirement is more difficult, because DFSORT doesn't have a built-in function for easily determining the non-padded length of a field.
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: Thu Mar 22, 2012 5:04 am
Reply with quote

Ashutosh,

Here's an example of the type of thing you could use for the returning file. You've got several fields to do this for, and your fields are longer than my test field of 10 bytes (which needs 11 tests). You'll also have the problem of having to include the HIT=NEXT for the subsequent fields.

What is there that can actually be changed before the file comes back to you? As in which of the fields? One, all, how many? Unless they were all potentially subject to change, I'd prefer a match (with JOINKEYS, for instance) for what is coming back. Lets you do a bit of validation, always good when getting data from "someone else".

I'd also consider having some code to validate the lengths you do have for the fields going out, to check against the PARSEd fields. Not to check that the PARSE is working, but as an opportunity to check that the binary fields are actually correct.


Code:
//STEPTSP EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
   OPTION COPY
   INREC IFTHEN=(WHEN=(1,10,CH,EQ,C' '),OVERLAY(11:C'00')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,1,CH),OVERLAY(11:C'01')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,2,CH),OVERLAY(11:C'02')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,3,CH),OVERLAY(11:C'03')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,4,CH),OVERLAY(11:C'04')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,5,CH),OVERLAY(11:C'05')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,6,CH),OVERLAY(11:C'06')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,7,CH),OVERLAY(11:C'07')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,8,CH),OVERLAY(11:C'08')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,9,CH),OVERLAY(11:C'09')),
         IFTHEN=(WHEN=(1,10,CH,EQ,1,10,CH),OVERLAY(11:C'10'))
//SORTIN DD *
1010101010
999999999
88888888
7777777
666666
55555
4444
333
22
1
                                   INTENTIONALLY BLANKS
        10
        9
       8
      7
     6
    5
   4
  3
 2
1                                  OH, RATS!
                                   STILL INTENTIONALLY BLANKS
 


Output is:
Code:

101010101010                                                 
999999999 09                                                 
88888888  08                                                 
7777777   07                                                 
666666    06                                                 
55555     05                                                 
4444      04                                                 
333       03                                                 
22        02                                                 
1         01                                                 
          00                       INTENTIONALLY BLANKS     
        1010                                                 
        9 09                                                 
       8  08                                                 
      7   07                                                 
     6    06                                                 
    5     05                                                 
   4      04                                                 
  3       03                                                 
 2        02                                                 
1         01                       OH, RATS!                 
          00                       STILL INTENTIONALLY BLANKS
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Mar 22, 2012 11:57 am
Reply with quote

Thank a lot frank. It worked. icon_smile.gif
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: Tue Mar 27, 2012 12:53 am
Reply with quote

I've been playing around with the idea of checking the two field lengths from the record against the output.

This is fairly brutal. I've hacked Frank's code, to make it easier to test since TS didn't actually ask for it anyway. The important part is the inclusion of the field lengths (41,2,63,2) and the FTOV,VLTRIM=C' '

The second step then reads in the variable-length-record file, calculates what the record-length should have been if the field-lengths were correct (from the two field-lengths, the length of the field lengths, the number of delimiters (one in this case) and the RDW). Compares calculated to actual length and lists any anomolies.

I'd do this check as a matter of course. The length of those fields is being calculated again for the output record, so it should be verified against the existing field-length data.

Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&OUT,DISP=(OLD,PASS)
//SORTOUT DD DSN=&&VARF,DISP=(,PASS),SPACE=(CYL,1),UNIT=SYSDA
//SYSIN DD *
  OPTION COPY
  INREC IFOUTLEN=104,
        IFTHEN=(WHEN=INIT,
       BUILD=(41,2,63,2,
              43,20,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=22),
              65,30,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=32))),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,4,5,54,SQZ=(SHIFT=LEFT,PAIR=QUOTE))),
    IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C'""',C'|',C'"',C'')))
    OUTFIL FTOV,VLTRIM=C' '
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&VARF,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTREC IFOUTLEN=72,
         IFTHEN=(WHEN=INIT,
                  BUILD=(1,4,
                         C'N',
                         1,2,
                         5,2,BI,TO=ZD,LENGTH=5,
                         7,2,BI,TO=ZD,LENGTH=5,
                         +0,ADD,5,2,BI,ADD,7,2,BI,ADD,+9,
                          TO=BI,LENGTH=2,SEQNUM,8,ZD)),
         IFTHEN=(WHEN=(6,2,BI,NE,18,2,BI),
                  OVERLAY=(5:C'Y',
                           30:6,2,BI,TO=ZD,LENGTH=5,
                           C' WAS ACT ',
                           18,2,BI,TO=ZD,LENGTH=5,
                           C' WAS CALC'))
                                                         
  OUTFIL VTOF,OUTREC=(1:5,68),INCLUDE=(5,1,CH,EQ,C'Y')
/*
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Tue Mar 27, 2012 9:39 am
Reply with quote

Hi,

Below mentioned sort card will meet your requirement.

Part 1:

Code:
//STEP01  EXEC PGM=SORT                                         
//SYSPRINT  DD SYSOUT=*                                         
//SYSOUT    DD SYSOUT=*                                         
//SORTIN    DD *
100       RAHUL KUMAR                   ..IT ANALYST          ..USA                           0000123456
15489     JOHN SMIT                     ..PROJECT MANAGER     ..USA                           0000123456
366537    BIMAL ROY SEN                 ..SOFTWARE DEVELOPER  ..USA                           0000123456
/*
//SORTOUT  DD  DSN=<Output Dataset Name>,                   
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=(SYSDA,9),SPACE=(CYL,(25,50),RLSE),         
//             DCB=(RECFM=FB,LRECL=104)                         
//SYSIN  DD  *                                                 
 INREC IFTHEN=(WHEN=INIT,                                             
       BUILD=(1:1,10,                                                 
             11:11,30,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',           
             LENGTH=32),                                               
             43:43,20,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',           
             LENGTH=22),                                               
             65:65,30,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',           
             LENGTH=32),                                               
             97:95,10)),                                               
       IFTHEN=(WHEN=INIT,                                             
       BUILD=(1,106,                                                   
              SQZ=(SHIFT=LEFT,PAIR=QUOTE,PREBLANK=C'"',MID=C'|')))     
 SORT FIELDS=COPY                                                     
 OUTREC FINDREP=(IN=C'"',OUT=C'')                                     
/*                                                                     



Output:

Code:
100|RAHUL KUMAR|IT ANALYST|USA|0000123456             
15489|JOHN SMIT|PROJECT MANAGER|USA|0000123456         
366537|BIMAL ROY SEN|SOFTWARE DEVELOPER|USA|0000123456


Part 2:

Code:
//STEP01  EXEC PGM=SORT                                         
//SYSPRINT  DD SYSOUT=*                                         
//SYSOUT    DD SYSOUT=*                                         
//SORTIN    DD *                                               
100|RAHUL KUMAR|IT ANALYST|USA|0000123456                       
15489|JOHN SMIT|PROJECT MANAGER|USA|0000123456                 
366537|BIMAL ROY SEN|SOFTWARE DEVELOPER|USA|0000123456         
/*                                                             
//SORTOUT  DD  DSN=<Output Dataset Name>,                   
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=(SYSDA,9),SPACE=(CYL,(25,50),RLSE),         
//             DCB=(RECFM=FB,LRECL=104)                         
//SYSIN  DD  *                                                 
 INREC IFTHEN=(WHEN=INIT,                                       
       PARSE=(%01=(ENDBEFR=C'|',FIXLEN=10),                     
              %02=(ENDBEFR=C'|',FIXLEN=30),                     
              %03=(ENDBEFR=C'|',FIXLEN=20),                     
              %04=(ENDBEFR=C'|',FIXLEN=30),                     
              %05=(ENDBEFR=C'|',FIXLEN=10)),                   
       BUILD=(1:%01,11:%02,41:%03,
             61:%04,91:%05,101:C',',                                               
            102:%03,JFY=(SHIFT=RIGHT,LEAD=C',',TRAIL=C',',         
                LENGTH=22),                                         
            124:%04,JFY=(SHIFT=RIGHT,LEAD=C',',TRAIL=C',',         
                LENGTH=32))),                                       
       IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=101,INOUT=(C' ',C'1'))),
       IFTHEN=(WHEN=INIT,                                           
       PARSE=(%06=(ENDBEFR=C',',FIXLEN=100),                       
              %07=(ENDBEFR=C',',FIXLEN=20),                         
              %08=(ENDBEFR=C',',FIXLEN=20),                         
              %09=(ENDBEFR=C',',FIXLEN=30),                         
              %10=(ENDBEFR=C',',FIXLEN=30)),                       
       BUILD=(1:%06,101:%07,UFF,TO=ZD,LENGTH=20,                   
            121:%09,UFF,TO=ZD,LENGTH=30)),                         
       IFTHEN=(WHEN=INIT,                                           
       BUILD=(1:1,100,                                             
            101:+20,SUB,(101,1,ZD,ADD,102,1,ZD,ADD,103,1,ZD,ADD,   
            104,1,ZD,ADD,105,1,ZD,ADD,106,1,ZD,ADD,107,1,ZD,ADD,
            108,1,ZD,ADD,109,1,ZD,ADD,110,1,ZD,ADD,111,1,ZD,ADD,
            112,1,ZD,ADD,113,1,ZD,ADD,114,1,ZD,ADD,115,1,ZD,ADD,
            116,1,ZD,ADD,117,1,ZD,ADD,118,1,ZD,ADD,119,1,ZD,ADD,
            120,1,ZD),EDIT=(TT),                               
            103:+30,SUB,(121,1,ZD,ADD,122,1,ZD,ADD,123,1,ZD,ADD,
            124,1,ZD,ADD,125,1,ZD,ADD,126,1,ZD,ADD,127,1,ZD,ADD,
            128,1,ZD,ADD,129,1,ZD,ADD,130,1,ZD,ADD,131,1,ZD,ADD,
            132,1,ZD,ADD,133,1,ZD,ADD,134,1,ZD,ADD,135,1,ZD,ADD,
            136,1,ZD,ADD,137,1,ZD,ADD,138,1,ZD,ADD,139,1,ZD,ADD,
            140,1,ZD,ADD,141,1,ZD,ADD,142,1,ZD,ADD,143,1,ZD,ADD,
            144,1,ZD,ADD,145,1,ZD,ADD,146,1,ZD,ADD,147,1,ZD,ADD,
            148,1,ZD,ADD,149,1,ZD,ADD,150,1,ZD),EDIT=(TT)))     
 SORT FIELDS=COPY                                               
 OUTREC FIELDS=(1:1,40,41:101,2,ZD,TO=BI,LENGTH=2,             
               43:41,20,63:103,2,ZD,TO=BI,LENGTH=2,             
               65:61,30,95:91,10)                               
/*                                                             


Output:

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----
--------------------------------------------------------------------------------------------------------
100       RAHUL KUMAR                   ..IT ANALYST          ..USA                           0000123456
FFF4444444DCCED4DEDCD444444444444444444400CE4CDCDEEE444444444400EEC444444444444444444444444444FFFFFFFFFF
10000000009184302441900000000000000000000A93015138230000000000034210000000000000000000000000000000123456
--------------------------------------------------------------------------------------------------------
15489     JOHN SMIT                     ..PROJECT MANAGER     ..USA                           0000123456
FFFFF44444DDCD4EDCE44444444444444444444400DDDDCCE4DCDCCCD4444400EEC444444444444444444444444444FFFFFFFFFF
15489000001685024930000000000000000000000F79615330415175900000034210000000000000000000000000000000123456
--------------------------------------------------------------------------------------------------------
366537    BIMAL ROY SEN                 ..SOFTWARE DEVELOPER  ..USA                           0000123456
FFFFFF4444CCDCD4DDE4ECD4444444444444444401EDCEECDC4CCECDDDCD4400EEC444444444444444444444444444FFFFFFFFFF
36653700002941309680255000000000000000000226636195045553675900034210000000000000000000000000000000123456
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top