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 

Need add one record on the top of file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
hc_family
Beginner


Joined: 09 Feb 2016
Posts: 3
Topics: 1

PostPosted: Tue Feb 09, 2016 3:39 pm    Post subject: Need add one record on the top of file Reply with quote

Hi,

I need add one below record start record 1 column 1 in a file:

PatientReport02092016

The 02092016 is current date, the format is mmddyyyy.

Would you please help me to do this task?

Thank you so much! I appreciate it very much!

Helen
Back to top
View user's profile Send private message
hc_family
Beginner


Joined: 09 Feb 2016
Posts: 3
Topics: 1

PostPosted: Tue Feb 09, 2016 3:44 pm    Post subject: Reply with quote

Add more detail:
The file has already has data:

xxxxxxxxx
xxxxxxxxx
.....

Need add one record above the first original record:

PatientReport02092016
xxxxxxxxx
xxxxxxxxx
...
...

Should I use SYNSNCSORT or IEBGENER, or other Utilities?

Thank you so much!!!

Helen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Tue Feb 09, 2016 3:45 pm    Post subject: Reply with quote

hc_family,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                             
----+----1----+----2----+----3----+----4----
A                                           
B                                           
C                                           
D                                           
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                             
  OPTION COPY                               
  OUTFIL REMOVECC,                         
  HEADER1=('PatientReport',DATENS=(MD4))   
//* 


The output from the above job is

Code:

PatientReport02092016
A                     
B                     
C                     
D                     

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hc_family
Beginner


Joined: 09 Feb 2016
Posts: 3
Topics: 1

PostPosted: Tue Feb 09, 2016 4:21 pm    Post subject: Reply with quote

YEAH!!! It worked. Thank you so much!!!

Helen
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 -> Job Control Language(JCL) 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