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

Syncsort to write static and dynamic fields


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

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Wed Mar 03, 2010 5:43 pm
Reply with quote

I have an input file with the date field. The format is 20100303.
I need to write an output file with the content as below:

FILE NAME CONSUMER.XXXXXXXX.PGP , where XXXXXXXX is dynamic and will be fetched from the input file. The other values (in red) are always static and also need to be populated in the output file. Hope I'm clear.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 03, 2010 5:56 pm
Reply with quote

Hi,

this will do the trick, assuming the the output LRECL is 80
Code:
//S1       EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
20100303.                                                           
/*                                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  OUTREC BUILD=(C'FILE NAME CONSUMER.',1,8,C'.PGP',80:X)             
/*                                                                   



Gerry
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: Wed Mar 03, 2010 8:35 pm
Reply with quote

Hello,

If the Xs are supposed to contain the date from the input file, it could be used for a Windows/UNIX file, but that would be an invalid dataset name on the mainframe.
Back to top
View user's profile Send private message
annu zacson

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 10:25 am
Reply with quote

Thanks Gerry..

This worked.. icon_biggrin.gif
Back to top
View user's profile Send private message
annu zacson

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 10:37 am
Reply with quote

Hi,

Now i got one line in the output file as below:

FILE NAME CONSUMER.20100303.PGP

Is it possible to write one more line in the output file as below from the same input file.

FILE NAME CONSUMER.20100303.PGP
DATE OF REPORTING 20100303


Thanks
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 04, 2010 11:42 am
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
20100303.                                               
/*                                                     
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION COPY                                           
  OUTFIL OUTREC=(C'FILE NAME CONSUMER.',1,8,C'.PGP',/, 
                C'DATE OF REPORTING ',1,8,80:X)         


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

New User


Joined: 19 Aug 2008
Posts: 15
Location: Cochin

PostPosted: Thu Mar 04, 2010 3:15 pm
Reply with quote

Thanks Gerry..this worked..
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
Search our Forums:

Back to Top