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

Is it possible to SORT horizontally using JCL


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

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Apr 13, 2007 10:29 pm
Reply with quote

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

DFSORT Developer


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

PostPosted: Fri Apr 13, 2007 11:20 pm
Reply with quote

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. icon_biggrin.gif

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

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 11:17 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Sat Apr 14, 2007 11:27 pm
Reply with quote

Hello,

You need to post the entire sysout from the sort - not just some part of it. . .
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 11:36 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Sun Apr 15, 2007 1:51 am
Reply with quote

Hello,

The messages describe your situation. . .

You are using Syncsort - the posted solution is for DFSORT.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 16, 2007 11:11 am
Reply with quote

Yes i am using SYNCSORT icon_sad.gif
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top