how to obtain it



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

how to obtain it

Postby samb01 » Tue Jan 21, 2014 9:01 pm

Hello,

i have a file with :


***************************** To
AACADPQ                         
AACBODQ                         
AACBOEQ                         
AACCHEQ                         
AACDCLQ                         
AACEFFQ                         
AACGRFQ                         
AACINSQ                         
AACORFX                         
AACQUOQ                         
AACRBAQ                         
AACSASQ                         




and i'd like to obtaine this :

----+----1----+----2----+----3----+----4----+----5----+--
ACTION=LIST,RESOURCE=ADCOM,ADID=AACADPQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBODQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBOEQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACCHEQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACDCLQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACEFFQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACGRFQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACINSQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACORFX        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACQUOQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACRBAQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACSASQ        ,STATUS=A;




Thank's for your help
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: how to obtain it

Postby BillyBoyo » Tue Jan 21, 2014 9:26 pm

You have two constants and some data from a record, at 1,7. So you BUILD a new record with Constant1,Data,Constant2.

  INREC BUILD=(C'ACTION=LIST,RESOURCE=ADCOM,ADID=',1,7,C'        ,STATUS=A;')
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: how to obtain it

Postby dgmf » Wed Jan 22, 2014 3:23 pm

Hi,

Using OUTREC FIELDS , we can acheive your goal :)
please have a look into below code, :)

 SORT FIELDS=COPY                                     
 OUTREC FIELDS=(C'ACTION=LIST,',C'RESOURCE=ADCOM,',   
             C'ADID=',1,7,10X,C',STATUS=A;')         



and below is the output from the job
********************************* Top of Data **************
ACTION=LIST,RESOURCE=ADCOM,ADID=AACADPQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBODQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBOEQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACCHEQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACDCLQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACEFFQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACGRFQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACINSQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACORFX          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACQUOQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACRBAQ          ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACSASQ          ,STATUS=A;


Thanks
Dev
dgmf
 
Posts: 7
Joined: Tue Jan 21, 2014 4:18 pm
Location: Bangalore,India
Has thanked: 0 time
Been thanked: 0 time

Re: how to obtain it

Postby BillyBoyo » Wed Jan 22, 2014 6:47 pm

That's exactly the same as mine, except you decided to complicate it by using OUTREC with FIELDS (why not use BUILD, which is not "overloaded"?) and specify the literals individually.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: how to obtain it

Postby dgmf » Thu Jan 23, 2014 9:47 am

Hi BillyBoyo,

Recently used the code for same kind of requirement,so thought of sharing.

I didnt get about this
BillyBoyo wrote:(why not use BUILD, which is not "overloaded"?)
:?

Is there any disadvantages using OUTREC over BUILD,If you dont mind ,Could you please explain me. :)
dgmf
 
Posts: 7
Joined: Tue Jan 21, 2014 4:18 pm
Location: Bangalore,India
Has thanked: 0 time
Been thanked: 0 time

Re: how to obtain it

Postby BillyBoyo » Thu Jan 23, 2014 3:46 pm

My initial point was, if you don't know that what you provided was the same as what I provided, then you have some understanding to do.

There are three places where amendments can be made to data: INREC; OUTREC; OUTFIL.

In a COPY operation, the results will be the same whichever you use. For some reason people think that OUTREC, and especially OUTREC FIELDS=, has some magical powers. It does not.

The BUILD vs FIELDS/OUTREC is this... oh, did I say OUTREC? Can you start to see the confusion? OUTREC FIELDS exists and OUTFIL OUTREC exists. Experiment. OUTREC FIELDS and OUTFIL OUTREC do the same thing, but other stuff which is on OUTREC don't work on OUTFIL OUTREC, although they do work on OUTFIL. Confused? That's because it makes it confusing.

FIELDS on INREC and OUTREC and OUTREC on OUTFIL are available for backwards-compatability. Use BUILD for all new code. My advice, to keep things simple and easy to understand. Makes no difference to the processing.

FIELDS is used on SORT, MERGE, INREC, OUTREC, REFORMAT... and means different things depending on the use.

BUILD is used on INREC, OUTREC and OUTFIL and only means BUILD.

INREC BUILD = INREC FIELDS
OUTREC BUILD = OUTREC FIELDS
OUTFIL BUILD = OUTFIL OUTREC

SORT FIELDS=, MERGE FIELDS=, REFORMAT FIELDS=, not equal to BUILD.

These users thanked the author BillyBoyo for the post:
Peter_Mann (Thu Jan 23, 2014 9:51 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: how to obtain it

Postby dgmf » Thu Jan 23, 2014 4:06 pm

Intially its confusing,but got your point.
Thanks for your time and explaination 8-) :)
dgmf
 
Posts: 7
Joined: Tue Jan 21, 2014 4:18 pm
Location: Bangalore,India
Has thanked: 0 time
Been thanked: 0 time

Re: how to obtain it

Postby samb01 » Tue Jan 28, 2014 4:07 pm

Hello,

i don't have what i want in the result fiel...
I'a sorry i forgott telling you an important thing .

The file input have words with different lenght

AACADPQ                         
AACBODQ                         
AACBOEQ                         
FGFTUJYHTRR
AACCHEQ                         
AACDCLQ
VVVVVFGG
AACEFFQ                         
AACGRFQ       
FTJOUR06H00RT
BGGJJMVBBB
AACINSQ                         
AACORFX               


With a maximum of 16 record
So, if the word dosen't have a lenght of 16 record, we cab add space to have :

ACTION=LIST,RESOURCE=ADCOM,ADID=AACADPQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBODQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBOEQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=FTJOUR06H00RT  ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACDCLQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACEFFQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACGRFQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACINSQ        ,STATUS=A;
ACTION=LIST,RESOURCE=ADCOM,ADID=AACORFX        ,STATUS=A;


And i don't anderstand why i have dots at the end of each recods...
I see it only in browse mode

ACTION=LIST,RESOURCE=ADCOM,ADID=AACADPQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBODQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACBOEQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACCHEQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACDCLQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACEFFQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACGRFQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACINSQ        ,STATUS=A;.....................................
ACTION=LIST,RESOURCE=ADCOM,ADID=AACORFX        ,STATUS=A;.....................................


Here is the sysin i use :

SORT FIELDS=COPY                                 
INREC BUILD=(C'ACTION=LIST,',C'RESOURCE=ADCOM,',
C'ADID=',1,7,C'       ',C'STATUS=A;')           



Thank's for your help.
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: how to obtain it

Postby dgmf » Tue Jan 28, 2014 4:17 pm

Hi,
for avoiding continues dots,you can reduce the record length.

Regards
Dev
dgmf
 
Posts: 7
Joined: Tue Jan 21, 2014 4:18 pm
Location: Bangalore,India
Has thanked: 0 time
Been thanked: 0 time

Re: how to obtain it

Postby samb01 » Tue Jan 28, 2014 7:09 pm

Hello,

is there an other way to avoid dots... Because the porgramm i use need a DCB with FB et LENGHT=80.
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post