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

Write each format in a new line


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

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Mon May 17, 2010 7:07 pm
Reply with quote

Hi all,

I am working on some tutorials of SYNCSORT.

I am looking in to all the dates and time formats supported by SYNCSORT.

Presently I am using the following code (X) to introduce 2spaces between each format.

Code:
SORT FIELDS=COPY                                     
OUTREC FIELDS=(1,6,X,DATE1,2X,TIME1,2X,DATE2,2X,DATE3)


I want to write each format in a different line..As a different record in the SORTOUT file.

Also while using this I cannot have a empty SORTIN file and hence I have to give some random record.Can this be avoided?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon May 17, 2010 8:31 pm
Reply with quote

show the required output and input you are using.
what is RECFM\LRECL of input\output files.
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: Mon May 17, 2010 9:39 pm
Reply with quote

Hello,

Not tested, but instead of 2X try / . . .
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Tue May 18, 2010 11:01 am
Reply with quote

Sambhaji,

No I/P file being used. I have just added a dummy record 123456 in the SORTIN DD card statement.

O/P is SYSOUT

Dick,

I had already tried '/' but even that is not working. I get syntax error at that point.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue May 18, 2010 11:13 am
Reply with quote

Hi,

you should post all job output to get better response, the problem is you cannot use the '/' with OUTREC.

Try this
Code:
//SORT0001 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
123456                                                   
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
 SORT FIELDS=COPY                                       
 OUTFIL BUILD=(1,6,/,DATE1,/,TIME1,/,DATE2,/,DATE3)     
/*


Gerry
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Tue May 18, 2010 12:03 pm
Reply with quote

Thanks,

This is working fine
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Tue May 18, 2010 12:59 pm
Reply with quote

Sorry, to continue on this topic....

This time I am using an input file
Code:
Organization  . . . : PS
Record format . . . : FB
Record length . . . : 80
Block size  . . . . : 800


And an output file
Code:
Organization  . . . : PS
Record format . . . : FB
Record length . . . : 80
Block size  . . . . : 800


with the contents of Input file as
Code:
----+----1----+----2----+----3
DATE          :                   
DATE1         :                   
DATE1(-)      :                   
DATE2         :                   
DATE2(-)      :                   
DATE3         :                   
DATE4         :                   
DATE(DMY-)    :                   
DATE(DM4-)    :                   
DATENS=(4DM)  :                   


How do I code in the JCL using SYNCSORT in which I get output as
Code:
----+----1----+----2----+----3----+----4
DATE          : 05/18/10               
DATE1         : 20100518               
DATE1(-)      : 2010-05-18             
DATE2         : 201005                 
DATE2(-)      : 2010-05                 
DATE3         : 2010138                 
DATE4         : 2010-05-18-03.21.52     
DATE(DMY-)    : 18-05-10               
DATE(DM4-)    : 18-05-2010             
DATENS=(4DM)  : 20101805               



Also I tried out
Code:
SORT FIELDS=COPY                                                       
OUTFIL BUILD=(1,17,2X,DATE,/,                                         *
              1,17,2X,DATE1,1/,                                       *
              1,17,2X,DATE1(-),1/,                                    *
              1,17,2X,DATE2,1/,                                       *
              1,17,2X,DATE2(-),1/,                                    *
              1,17,2X,DATE3,1/,                                       *
              1,17,2X,DATE4,1/,                                       *
              1,17,2X,DATE(DMY-),1/,                                  *
              1,17,2X,DATE(DM4-),1/,                                  *
              1,17,2X,DATENS=(4DM))                                   

But somewhere I am going wrong and i get
Code:
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=   800     
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=   800     
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL                         
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: Tue May 18, 2010 7:24 pm
Reply with quote

Hello,

Change SORTOUT to a proper lrecl or force the data to be 80 . . .
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top