Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Append a 6 byte string after the each records of a file
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

Moderator


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

PostPosted: Tue Jun 04, 2013 1:53 pm    Post subject:
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: 269
Location: Mumbai

PostPosted: Tue Jun 04, 2013 2:12 pm    Post subject:
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

Moderator


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

PostPosted: Tue Jun 04, 2013 2:32 pm    Post subject:
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    Post subject: Reply to: Append a 6 byte string after the each records of a
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    Post subject: Reply to: Append a 6 byte string after the each records of a
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 04, 2013 3:00 pm    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Tue Jun 04, 2013 3:06 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jun 04, 2013 3:24 pm    Post subject:
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: 269
Location: Mumbai

PostPosted: Tue Jun 04, 2013 3:29 pm    Post subject: Reply to: Append a 6 byte string after the each records of a
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us