How to reformat



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

How to reformat

Postby deva_048 » Fri Aug 16, 2013 12:36 pm

My input dataset looks like below

----+----1----+----2----+----3----+----4----+----5----+----6----+
********************************* Top of Data *******************
  JOBDD413                    --------- STRING(S) FOUND         
-------------------                                             
       2  AFILE=I00.YYYY.DATA                               
       3  FILE=B_TEST_.DATA             
  JOBDD414                    --------- STRING(S) FOUND         
-------------------                                             
       2  AFILE=I01.YYYY.DATA                                 
       3  FILE=A_TEST_.DATA             


Output dataset should be:
JOBDD413      I00.YYYY.DATA   B_TEST_.DATA
JOBDD414      I01.YYYY.DATA   A_TEST_.DATA


Is it possible? I tried outrec but cant get the expected ouput .. please help me on this
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to reformat

Postby BillyBoyo » Fri Aug 16, 2013 1:09 pm

Yes, it is possible. Which SORT product do you use (your topice can be moved to the appropriate place here)?

To get data from one record to another you need IFTHEN=(WHEN=GROUP. You will need two of them. Is your data entirely regular ase shown? Strictly one 2 and one 3 and nothing else per JOBxxxxx, and all JOBxxxxx starting with JOB?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to reformat

Postby deva_048 » Fri Aug 16, 2013 2:29 pm

JOB name which will start with prefix JOBxxxxx.
Sort product Details:
SYNCSORT FOR Z/OS 1.4.1.0R

Yes, my data looks like mentioned in input dataset.
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to reformat

Postby BillyBoyo » Fri Aug 16, 2013 2:53 pm

First, you need an INCLUDE COND= which will get you the records you want and keep the other stuff out of the way. You'll need at least one OR.

Take care that the data is reliably identified - although it doesn't matter in this example, it may in another.

Once you can show that working, we can get to the next bit.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to reformat

Postby deva_048 » Fri Aug 16, 2013 2:58 pm

Can you please show the sample code to acheive the output? I have tried include cond to satisfy first 3 columns contain name JOB to retrieve the records and do not know how to write the data files name in same line...
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to reformat

Postby BillyBoyo » Fri Aug 16, 2013 3:07 pm

  INCLUDE COND=(start,length,type,value,
             OR,start1,length1,type1,value1)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to reformat

Postby deva_048 » Fri Aug 16, 2013 3:38 pm

thanks billy. i will work it out and let you know..
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to reformat

Postby deva_048 » Fri Aug 16, 2013 3:44 pm

Tried below code. not getting my expected output
INCLUDE COND=(3,3,CH,EQ,C'JOB',OR,
           11,5,CH,EQ,C'AFILE',OR,
           11,4,CH,EQ,C'FILE')     
OUTREC FIELDS=(1:2,10,15:17,40)   
SORT FIELDS=COPY
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to reformat

Postby BillyBoyo » Fri Aug 16, 2013 4:56 pm

Take out the OUTREC.

The INCLUDE is fine. I would use 2,4,CH,EQ,C' JOB' and check for AFILE= and FILE= (increasing the lengths appropriately). Reduces the chance of an "accidental hit". Doesn't matter with your data, but for the next one, or the one after that....

Without the OUTREC, you should get just the three lines with the information that you want.

  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,4,CH,EQ,C' JOB'),
                         PUSH=(81:2,7))


Look at the output that you get. Your three records which are part of the GROUP now have the information from the first record. You need to do something similar to get the data from the second record on to the third (without blatting the data from the first). Then you can format the third record, and use OUTFIL OMIT= to discard the no-longer required first two records of each group.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to reformat

Postby deva_048 » Fri Aug 16, 2013 5:44 pm

Yes i can able to group it ... finally how to outfil the record grouped lines into a single line

----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
********************************* Top of Data *************************
 JOBDD413                    --------- STRING(S) FOUND         JOBDD413
      2  LFILE=I00.I0021102.DATA                               JOBDD413
      3  FILE=/home/user/A_MEM.DATA                            JOBDD413


How to get the below expected into a single line by above grouping..

JOBDD413  I00.I0021102.DATA  A_MEM.DATA
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post