View previous topic :: View next topic
|
Author |
Message |
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Is it possible to SORT horizontally using JCL.
Input given as
CAT RAT PAT MAT ACT
TAR BAR CAR AIR RAR
should be sorted to give
ACT CAT MAT PAT RAT
AIR BAR CAR RAR TAR |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. You get extra points for including my favorite pet (RAT) in your data.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/25)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/25)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) TO(T2) USING(CTL2)
SPLICE FROM(T2) TO(OUT) ON(26,8,ZD) -
WITHEACH WITH(6,5) WITH(11,5) WITH(16,5) WITH(21,5) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,
BUILD=(1,5,1,5,1,5,1,5,1,5,SEQNUM,8,ZD,/,
6,5,6,5,6,5,6,5,6,5,SEQNUM,8,ZD,/,
11,5,11,5,11,5,11,5,11,5,SEQNUM,8,ZD,/,
16,5,16,5,16,5,16,5,16,5,SEQNUM,8,ZD,/,
21,5,21,5,21,5,21,5,21,5,SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
SORT FIELDS=(26,8,ZD,A,1,5,CH,A)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(1,25)
/*
|
|
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Hi,
This job is failing for me with ABEND code U016.
CALLER-PROVIDED IDENTIFIER IS "0001"
OUTFIL STATEMENT : SYNTAX ERROR
This was the message for SORT.
Let me check
thanks anyways |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post the entire sysout from the sort - not just some part of it. . . |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
SYNCSORT FOR Z/OS 1.1BRI TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.6.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 8D27F, MODEL 2084 309 LICEN
CTL1CNTL :
OUTFIL FNAMES=T1, 0015000
BUILD=(1,5,1,5,1,5,1,5,1,5,SEQNUM,8,ZD,/, 0016000
*
6,5,6,5,6,5,6,5,6,5,SEQNUM,8,ZD,/, 0017000
11,5,11,5,11,5,11,5,11,5,SEQNUM,8,ZD,/, 0018000
16,5,16,5,16,5,16,5,16,5,SEQNUM,8,ZD,/, 0019000
21,5,21,5,21,5,21,5,21,5,SEQNUM,8,ZD) 0020000
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The messages describe your situation. . .
You are using Syncsort - the posted solution is for DFSORT. |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Yes i am using SYNCSORT |
|
Back to top |
|
|
|
|