|
View previous topic :: View next topic
|
| Author |
Message |
Chanchal Majumder
New User
Joined: 09 Jul 2012 Posts: 10 Location: INDIA
|
|
|
|
Hi ..
I have to append a 8 byte(Suppose COMPLETE ) string after the each records of a file .
The records may be of variable length .
Example :
INPUT file :
MAINFRAME123
COBOL 456
ICETOOL 789
OUTPUT file:
MAINFRAME123COMPLETE
COBOL 456COMPLETE
ICETOOL 789COMPLETE
Any idea how i can do these using icetool.
Any help much appreciated.
Thanks & Regards,
Chanchal. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi,
I see space after COBOL & ICETOOL and not after MAINFRAME.
Is that the way it is supposed to be or typo?
Please always post the data using code tags |
|
| Back to top |
|
 |
chandan.inst
Active User

Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
Assuming your input file if FB with record length 80. and this file has variable records which are less than 74 in length as you have provided
Try below JCL
| Code: |
//STEP002 EXEC PGM=SORT
//SORTIN DD *
MAINFRAME123
COBOL 456
ICETOOL 789
//SORTOUT DD SYSOUT=*
//*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,80,JFY=(SHIFT=LEFT,TRAIL=C'COMPLETE',LENGTH=80))
/* |
Output of above JCL
| Code: |
MAINFRAME123COMPLETE
COBOL 456COMPLETE
ICETOOL 789COMPLETE |
Hope this helps
Regards,
Chandan |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Chandan,
You dont need to mention LENGTH=80 in this case |
|
| Back to top |
|
 |
Chanchal Majumder
New User
Joined: 09 Jul 2012 Posts: 10 Location: INDIA
|
|
|
|
Hi Pandora,
This is not a typo..There are spaces between the records and i need to append the string at last .
Thanks,
Chanchal |
|
| Back to top |
|
 |
Chanchal Majumder
New User
Joined: 09 Jul 2012 Posts: 10 Location: INDIA
|
|
|
|
Hi Chandan.
[ SORT FIELDS=COPY
OUTREC FIELDS=(1:4,5:1,80,JFY(SHIFT=LEFT,TRAIL=C'COMPLETE',LENGTH=80))
*
OUTREC STATEMENT : SYNTAX ERROR ]]
Any idea ?
Did you run that JCL successfully ? |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
| Please show the error message codes as well |
|
| Back to top |
|
 |
Chanchal Majumder
New User
Joined: 09 Jul 2012 Posts: 10 Location: INDIA
|
|
|
|
Hi Expat,
IN SSMSG :
IN SS msg :
CTL1CNTL :
SORT FIELDS=COPY
OUTREC FIELDS=(1:4,5:1,200,JFY=(SHIFT=LEFT,TRAIL=C'COMPLETE'))
*
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000 |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
WER is a syncsort message
Syncsort questions should be in JCL forum
And Chandan's code worked like a gem in DFSORT product |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
| Moved to the correct section. |
|
| Back to top |
|
 |
chandan.inst
Active User

Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi Pandora,
Agree with you, length parameter is not required, I did it for my testing and missed to remove while replying
Chanchal,
This code should work for Syncsort as well.
if you need first 4 bytes seperatly then change the control card as below
| Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:1,80,JFY=(SHIFT=LEFT,TRAIL=C'COMPLETE')) |
Please start using Code tags its very useful for understanding
Regards,
Chandan |
|
| Back to top |
|
 |
|
|