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
 

 

How to concatenate string in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Mon Apr 13, 2009 2:40 pm    Post subject: How to concatenate string in JCL
Reply with quote

Hi All,

I want to concatenate the two lines in a file.

Ex
input file contains two lines
abc
def

I want the ouput like
abcdef

Using rexx it can be done. But with JCL how to achieve it.

Thanks,
Ashok
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: Mon Apr 13, 2009 3:12 pm    Post subject:
Reply with quote

Which program or utility would you like your JCL to execute to achieve this.
Back to top
View user's profile Send private message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Mon Apr 13, 2009 3:21 pm    Post subject:
Reply with quote

I want this using Utility like SORT/ICETOOL/ICEMAN or any other utility.Not with programs.

Thanks,
Ashok
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Apr 13, 2009 4:18 pm    Post subject:
Reply with quote

Hi,

Data which you show is kind of not sufficent to start with a solution approach, can you have duplicates, such as:
Code:
ABC
ABC
PQR
PQR
PQR
what should be the output?

What if there are three or more records:
Code:
ABC
DEF
GHI
JKL
MNO
what should be the output? What is LRECL & RECFM of input? Please show a rather complete input.
Back to top
View user's profile Send private message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Mon Apr 13, 2009 5:05 pm    Post subject:
Reply with quote

Hi,

No duplicates allowed and right now i hav only 2 records to concatenate.

Im not using file as input.

Im passing the two record like
//IN DD *
abc
def
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 13, 2009 9:43 pm    Post subject:
Reply with quote

If that's really all you want to do, you can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
abc
def
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(4:1,3)),
    IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,3))
  OUTFIL STARTREC=2
/*
Back to top
View user's profile Send private message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Wed Apr 15, 2009 10:47 am    Post subject:
Reply with quote

I tried ur above code but showing syntax error in WHEN=GROUP

this is how i pass in input
//SORTIN DD *
A
01
12345678
1
1234567890
123456789
/*
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 15, 2009 12:10 pm    Post subject:
Reply with quote

Hi,

1. Are you a DFSORT user or a SyncSort?
2. If SyncSort, which version of it?
3. If DFSORT, you need to have PTF UK90013 for z/OS DFSORT V1R5 (July, 2008) which provides important enhancements to DFSORT and DFSORT's ICETOOL to use group operations (WHEN=GROUP) among others.

You give us nothing to work on, something is "giving syntax error" does not convey anything - you should have posted the complete diagnostic information.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 15, 2009 1:50 pm    Post subject:
Reply with quote

Hello,

Is there some reason y9ou did not post the actual error message code and error text icon_confused.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 15, 2009 8:51 pm    Post subject:
Reply with quote

Ashok,

You said:

Quote:
No duplicates allowed and right now i hav only 2 records to concatenate.


so I gave you a solution for that.

Now you are showing SORTIN with more than 2 records so you've changed the requirement but not given the needed details of what you're trying to do. The original job was for the original requirement, not this new requirement, whatever it is.

And when you say:

Quote:
I tried ur above code but showing syntax error in WHEN=GROUP


you need to show the //SYSOUT messages you received.
Back to top
View user's profile Send private message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Thu Apr 16, 2009 10:39 am    Post subject:
Reply with quote

Frank,

This executed with 2 records. pls find below i Just copied and pasted.

Symbol '$ ' was shown at bottom of WHEN=GROUP.

Think so this mainframe need some patches to support.

********************************* TOP OF DATA **********************************
1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 10:33 ON THU AP
0 OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(4:1,3)),
IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,3))
$
ICE007A 0 SYNTAX ERROR
OUTFIL STARTREC=2
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E7-K90000
ICE052I 3 END OF DFSORT
******************************** BOTTOM OF DATA ********************************[/img][/url][/quote]
Back to top
View user's profile Send private message
Ashok09

New User


Joined: 29 Mar 2009
Posts: 20
Location: Chennai

PostPosted: Thu Apr 16, 2009 10:46 am    Post subject:
Reply with quote

Frank,

Using ur above code i thought to implement for more than 2 records by changing some fields in sort card.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Apr 16, 2009 3:37 pm    Post subject:
Reply with quote

Ashok09 wrote:
..by changing some fields in sort card.
This is nonsense - who knows what you did at your end and after doing that you claim
Quote:
I tried ur above code but showing syntax error in WHEN=GROUP
. . . icon_evil.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 16, 2009 9:02 pm    Post subject:
Reply with quote

Quote:
Symbol '$ ' was shown at bottom of WHEN=GROUP.

Think so this mainframe need some patches to support.


You need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use WHEN=GROUP. Ask your System Programmer to install it.

Quote:
Using ur above code i thought to implement for more than 2 records by changing some fields in sort card.


It doesn't work that way. Your stated requirement was for two records so I set up the job for that. If you have a different requirement, then you need to explain that requirement in detail.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


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