Inserting comment lines



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

Inserting comment lines

Postby ibmmf4u » Thu May 24, 2012 10:45 pm

Hi All,

My requirement goes this way, i need to insert new comment lines into a file. Pasted below is an example.

Inputfile:-
TEST1
TEST2
TEST3


Outputfile:-
FIELD
VALUE
TEST1
END OF FIELD
FIELD
VALUE
TEST2
END OF FIELD
FIELD
VALUE
TEST3
END OF FIELD


I just want to insert three new lines.

Can someone provide me the sort card in achieving the above.

Thanks in advance!!
ibmmf4u
 
Posts: 65
Joined: Wed Dec 14, 2011 10:26 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Inserting comment lines

Postby BillyBoyo » Thu May 24, 2012 11:11 pm

Look at your docs and see if your Syncsort supports the slash-operator on OUTFIL. This allows multiple records to be formatted with, for instance, BUILD. BUILD=(C'A',/,C'B',/,C'C',/C'D') should then produce four records, one byte long.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Inserting comment lines

Postby dick scherrer » Fri May 25, 2012 12:45 am

Hello,

Yup, Syncsort supports OUTFIL amd BUILD.

There are many examples in our Syncsort part of the forum.

If you find something that is not clear, post what you found and your doubt. Someone will be able to clarify.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Inserting comment lines

Postby ibmmf4u » Fri May 25, 2012 10:06 am

Hi Bill and Dick,

Thanks a lot. Pasted below is the piece of code that's working fine as per the requirement.

//STEP010   EXEC PGM=SORT
//SYSPRINT DD     SYSOUT=*
//SYSOUT    DD    SYSOUT=*
//SORTIN    DD    *
TEST1
TEST2
TEST3
//SYSIN   DD   *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
           BUILD=(C'FIELD',/,
                         C'VALUE',/,
                         1,8,/,
                         C'END OF FIELD')
/*


Output file:-

FIELD
VALUE
TEST1
END OF FIELD
FIELD
VALUE
TEST2
END OF FIELD
FIELD
VALUE


Thanks a lot again for your guidence once again.
ibmmf4u
 
Posts: 65
Joined: Wed Dec 14, 2011 10:26 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Inserting comment lines

Postby dick scherrer » Fri May 25, 2012 7:38 pm

Good to hear it is working - thank you for posting your solution :)

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


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post