2 weeks ago - last edited 2 weeks ago
I have an input file and i am trying to group it and create a text file in a particular format.
vnumber key1 suffx source amount product cust
102XX 2948S X Axis 100 prod1 cust1
102XX 2948S X Axis 50 prod1 cust1
102XX 2948S X Axis 200 prod2 cust2
245TX 1801 Y Base 250 prod1 cust1
245TX 1801 Y Base 320 prod2 cust1
809TX 2341 Z Code 313 prod1 cust1
810TX 2341 Z Code -826.88 prod1 cust1
I am trying to create the following output from above
|Record type||vnumber||key1||suffx||source||Number of lines||amount||Number of accounting lines||Accounting amount||VAR1|
I am trying to sort the input data by vnumber, key1, suffx, source
and extract first observation from each by group as record of the type "V" (header)
and the same record as Line and remaining records of the same group as L and would like to get the L record count in a variable
Once I am able to classify the records as V, L ..i need to check the records within L to see if prod and cust are same as prod and cust for previous records.
if they are same , then it can be treated as 1 'A'. If either of it is different, it has to be treated as different A. In the above example the first by group has distinct values for prod and cust
so it has two accounting lines and amounts also get added according to the accounting lines.
Finally I need to add a record 'P' for each group with an additional variable .
Please note that I had posted the same question partially as another thread which is closed right now .
Adding the previous post link here
Appreciate any help with this.
2 weeks ago
Please note that I had posted the same question partially as another thread which is closed right now
If the previous thread had a partial answer it might help to provide that here, or at a minimum a link to the other thread. Then provide what needs to added to the previous answer.
That might reduce having to answer the same questions that may have been asked in the previous thread.