|
View previous topic :: View next topic
|
| Author |
Message |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
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 |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
| Which program or utility would you like your JCL to execute to achieve this. |
|
| Back to top |
|
 |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
I want this using Utility like SORT/ICETOOL/ICEMAN or any other utility.Not with programs.
Thanks,
Ashok |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
 |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Is there some reason y9ou did not post the actual error message code and error text  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
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 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 |
|
 |
Ashok09
New User

Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
Frank,
Using ur above code i thought to implement for more than 2 records by changing some fields in sort card. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| 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 |
. . .  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
strg.mani
New User

Joined: 21 Jul 2012 Posts: 1 Location: INDIA
|
|
|
|
Hello Frank,
I used your code. It works perfectly fine for me. Can you help me, If the number of records are random but multiple of 2.
For example as following
----+----1----
**************
01DEC16T GB
24:00:00 59797
02DEC16F GB
24:00:00 59831
03DEC16S GB
24:00:00 59862
04DEC16S GB
24:00:00 59883
05DEC16M GB
24:00:00 59903
to the following
----+----1----
**************
01DEC16T 24:00:00 59797
02DEC16F 24:00:00 59831
03DEC16S 24:00:00 59862
04DEC16S 24:00:00 59883
05DEC16M 24:00:00 59903
Please let me know if this is even correct question. |
|
| Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| Do not tag your question onto a thread that's dormant for over eight years (Mr. Yaeger in fact retired four years ago and has not logged in since.) |
|
| Back to top |
|
 |
|
|