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

adding a record in the first line of a pS file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Thu Mar 12, 2009 7:40 pm
Reply with quote

Hi all.

I am having an input file of LRECL = 80,

Code:

----+----1----+----2----+----3----+----4----+--
12354 asdasdasd5 a asdasdad
123453 dfadasd
sdaadadsdada


I want to add a line "I am a Good Girl" at the top ( First line of the PS FILE ), irrespective of any condition.

So my output will come as below,
Code:

----+----1----+----2----+----3----+----4----+--
I am a Good Girl
12354 asdasdasd5 a asdasdad
123453 dfadasd
sdaadadsdada


Could you guys please provide some Sort card to do the Same.

Thanks in advance.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 12, 2009 7:52 pm
Reply with quote

You don't really even need SORT -- a simple concatenation and copy will do it:
Code:
//STEP1    EXEC PGM=IEBGENER,REGION=6M
//SYSIN    DD   DUMMY
//SYSPRINT DD   SYSOUT=*
//SYSUT1   DD   *,DCB=BLKSIZE=????
I AM A GOOD GIRL
/*
//         DD   DISP=SHR,DSN=<old file name>
//SYSUT2   DD   DSN=<new file name> ...
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 8:31 pm
Reply with quote

Quote:
Could you guys please provide some Sort card to do the Same.
A simple sort copy with a HEADER1 should do the trick.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 12, 2009 9:24 pm
Reply with quote

Niki,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFILE REMOVECC,
    HEADER1=('I am a Good Girl')
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top