IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Append a 6 byte string after the each records of a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Chanchal Majumder

New User


Joined: 09 Jul 2012
Posts: 10
Location: INDIA

PostPosted: Tue Jun 04, 2013 1:34 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 04, 2013 1:53 pm
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Tue Jun 04, 2013 2:12 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 04, 2013 2:32 pm
Reply with quote

Chandan,

You dont need to mention LENGTH=80 in this case
Back to top
View user's profile Send private message
Chanchal Majumder

New User


Joined: 09 Jul 2012
Posts: 10
Location: INDIA

PostPosted: Tue Jun 04, 2013 2:49 pm
Reply with quote

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
View user's profile Send private message
Chanchal Majumder

New User


Joined: 09 Jul 2012
Posts: 10
Location: INDIA

PostPosted: Tue Jun 04, 2013 2:55 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 04, 2013 3:00 pm
Reply with quote

Please show the error message codes as well
Back to top
View user's profile Send private message
Chanchal Majumder

New User


Joined: 09 Jul 2012
Posts: 10
Location: INDIA

PostPosted: Tue Jun 04, 2013 3:03 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 04, 2013 3:06 pm
Reply with quote

WER is a syncsort message icon_sad.gif

Syncsort questions should be in JCL forum

And Chandan's code worked like a gem in DFSORT product
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 04, 2013 3:24 pm
Reply with quote

Moved to the correct section.
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Tue Jun 04, 2013 3:29 pm
Reply with quote

Hi Pandora,

Agree with you, length parameter is not required, I did it for my testing and missed to remove while replying icon_smile.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top