MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Fri Oct 31, 2008 8:46 am Post subject: Add extra data at end of record using Syncsort
Hi All,
I have file1 which is varible legth i need to add data at end of each record.I have used the following but when i run it it is giving error.
File1 has this data
Code:
SIVA 12345SSSS
MALLI 123456
NISHANT 12345FFFF
JCL
Code:
//ISDXFJTW JOB (TEST),'TEST',TIME=1440,
// CLASS=F,MSGCLASS=X,NOTIFY=ISDXFJT,REGION=0K,
// USER=ISDXFJT,PASSWORD=
//*
//JSTY0020 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CUTTEMP1 DD DSN=FILE01,DISP=SHR
//RPRT10A DD SYSOUT=*
//TOOLIN DD *
DISPLAY FROM(CUTTEMP1) LIST(RPRT10A) -
* BLANK -
HEADER(' NAME ') ON(01,07,CH) -
HEADER(' CITY ') ON(10,09,CH,T'| INDIA | SSS ')
/*
Error
Code:
HEADER(' CITY ') ON(10,09,CH,T' | INDIA | SSS')
SYT212E "ON" VALUE IS NOT VALID
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
Thanks
Siva
Back to top
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Fri Oct 31, 2008 11:49 am Post subject:
Please identify your SyncSort release and provide an example of your desired output. _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Fri Oct 31, 2008 3:05 pm Post subject:
Hi Amargulies,
I don't know exactly the release of syncsort where do we get it from?
I have file file01 and have following report .
Data in the file
Code:
Name ID
---------- -----------
Siva 1234G56
Malli 1234VFS
Nishant 23456TF
I want to append INDIA at the end of the every record in the file.
Code:
Name ID
---------- --------
Siva 1234G56 INDIA
Malli 1234VFS INDIA
Nishant 2345689 INDIA
Another requirement of same sort
I have file file02 and have following report .
Data in the file
Code:
Name ID
---------- -----------
Srikanth 1234G56
Aizaz 1234VFS
Tulasi 23456TF
we are adding some data at the end of each record using below control card
Code:
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,25,27:C' member ')
It is adding like this
Code:
Name ID MEMBER
---------- ----------- MEMBER
Srikanth 1234G56 MEMBER
Aizaz 1234VFS MEMBER
Tulasi 23456TF MEMBER
I want like this
Code:
Name ID
---------- -----------
Srikanth 1234G56 MEMBER
Aizaz 1234VFS MEMBER
Tulasi 23456TF MEMBER
I don't want to append extra data to first two rcords.
Thanks,
SIva
Back to top
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Mon Nov 03, 2008 11:33 am Post subject:
For your first requirement, try this:
Code: //SORT1 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NAME ID
---------- --------
SIVA 1234G56
MALLI 1234VFS
NISHANT 23456TF
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1,4,CH,NE,L(C'NAME',C'----')),
OVERLAY=(23:C'INDIA'))
/*
Here is the output produced:
Code: NAME ID
---------- --------
SIVA 1234G56 INDIA
MALLI 1234VFS INDIA
NISHANT 23456TF INDIA
For your second file, the same control statements can be used, simply modify the position and character string for the OVERLAY portion of the OUTREC control statement. _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Nov 03, 2008 2:18 pm Post subject:
amargulies ,
If I am not mistaken , siva is creating the headers using the DISPLAY operator of ICETOOL. I don't think the initial File has the headers. _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Mon Nov 03, 2008 4:12 pm Post subject:
Kolusu,
I must have misunderstood when Siva specified "data in the file". If that is the case, then here is a modified job:
Code: //SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(23:C'INDIA')
OUTFIL HEADER2=(1:C'NAME',14:C'ID',/,
1:10C'-',14:8C'-')
/*
_________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
sivafdms Intermediate Joined: 29 May 2007 Posts: 165 Topics: 77
Posted: Tue Nov 11, 2008 1:52 am Post subject:
Amargulies,
Thanks for your jcl it's working perfectly fine according to my requirement.
Siva
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum