MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamic construction of sort card

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Mukunda
Beginner


Joined: 11 Dec 2002
Posts: 46
Topics: 15

PostPosted: Tue Jun 24, 2003 7:18 pm    Post subject: Dynamic construction of sort card Reply with quote

I have a file (say date file) of LRECL 400 that has date field in the form
YYMMDD - Pos 33 to 38.
I need to extract the date in MM/DD/YY format and construct a sort card
dynamically like this

Quote:
SORT FIELDS=COPY
INREC FIELDS=(1:23,5,6:254,8,14:12,4,MM/DD/YY)


This MM,DD,YY values are taken from date file. Can this be done with SYNCSORT Question
For example if the date file has

Quote:
32 bytes... 030624 ...rest of the bytes

Then I need to read this file and construct a sort card
Quote:
SORT FIELDS=COPY
INREC FIELDS=(1:23,5,6:254,8,14:12,4,06/24/03)
Back to top
View user's profile Send private message
Mukunda
Beginner


Joined: 11 Dec 2002
Posts: 46
Topics: 15

PostPosted: Tue Jun 24, 2003 7:28 pm    Post subject: Reply with quote

Oops...! it should be
Code:
SORT FIELDS=COPY
INREC FIELDS=(1:23,5,6:254,8,14:12,4,C'06/24/03')
Wink
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Jun 25, 2003 2:11 am    Post subject: Reply with quote

How many records do you have in the date file ?
________
TransCare


Last edited by coolman on Sat Feb 05, 2011 1:25 am; edited 1 time in total
Back to top
View user's profile Send private message
Mukunda
Beginner


Joined: 11 Dec 2002
Posts: 46
Topics: 15

PostPosted: Wed Jun 25, 2003 5:36 am    Post subject: Reply with quote

Just one, Coolman.
Back to top
View user's profile Send private message
Mukunda
Beginner


Joined: 11 Dec 2002
Posts: 46
Topics: 15

PostPosted: Wed Jun 25, 2003 8:52 am    Post subject: Reply with quote

I just managed to do this
Code:

 SORT FIELDS=COPY                     
 OUTFIL OUTREC=(C'SORT FIELDS=COPY',/,
        C'INREC FIELDS=(1:23,5,',     
        C'6:254,8,',                 
        C'14:12,4,',                 
        C'C',                         
        X'7D',                       
        35,2,                         
        C'/',                         
        37,2,                         
        C'/',                         
        33,2,X'7D')                   
Back to top
View user's profile Send private message
Glenn
Beginner


Joined: 23 Mar 2003
Posts: 56
Topics: 3

PostPosted: Wed Jun 25, 2003 10:10 am    Post subject: Reply with quote

I would think you would be able to use STRING in COBOL and output a LRECL80 F file with your sort parms and then use that as input for your sort on a subsequent step. But it sounds like you got it under control.
Back to top
View user's profile Send private message
Mukunda
Beginner


Joined: 11 Dec 2002
Posts: 46
Topics: 15

PostPosted: Wed Jun 25, 2003 10:23 am    Post subject: Reply with quote

Glenn
COBOL - String was my back up plan Wink
Actually I had to pad spaces and make up the record to LRECL of 80. Otherwise it automatically takes the output record length as the length of longest record output, irrespective of DCB parameters.
I got an error like
Code:
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL

So I modified it to
Code:
OUTFIL OUTREC=(2X,C'SORT FIELDS=COPY',
       62X,/,2X,
       C'INREC FIELDS=(1:23,5,',               
       C'6:254,8,',                             
       C'14:12,4,',                             
       C'C',                                   
       X'7D',                                   
       35,2,                                   
       C'/',                                   
       37,2,                                   
       C'/',                                   
       33,2,X'7D',30X)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group