Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort to write static and dynamic fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort to write static and dynamic fields
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: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 5:56 pm    Post subject:
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

Site Director


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

PostPosted: Wed Mar 03, 2010 8:35 pm    Post subject:
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    Post subject: Syncsort to write static and dynamic fields
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    Post subject: Syncsort to write static and dynamic fields
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: 1703
Location: Australia

PostPosted: Thu Mar 04, 2010 11:42 am    Post subject:
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    Post subject: Syncsort to write static and dynamic fields
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us