Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add 2 new rows at the end of file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Wed Apr 28, 2010 3:32 am    Post subject: Add 2 new rows at the end of file
Reply with quote

I need to add 2 new rows at the end of file at position 1 with the below file values
row 1 --> NEXT-PROCESSING-MONTH
row 2 --> AGENCY-CODE-USED

How can this be done using sort.

thanks
mstp
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Wed Apr 28, 2010 4:23 am    Post subject:
Reply with quote

Do you mean records, not rows? Are you talking about a file, not a data base table? Please be more specific about your requirement.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Wed Apr 28, 2010 4:32 am    Post subject:
Reply with quote

Terminology is critical in IT, where similar sounding terms mean very different things. Files do not have rows, so you cannot add rows to the end of a file. Files have records, while data bases have rows. as Terry alluded. Since you have confused a very basic term, we cannot answer your question.

If you really want to add rows to a file, the answer is that it cannot be done. Period. If you mean to add records to the end of a file, or rows to the end of a data base, you have not provided anywhere near enough information for a realistic answer. In the first case, what is the file record length? Are the records fixed length or variable length? If you're wanting to add rows to a data base, are you talking Oracle? IDMS? DB2? IMS? Some other data base?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Apr 28, 2010 4:57 am    Post subject:
Reply with quote

MSTP,

Assuming you have an input file and you want to add records with DFSORT, please show an example of your input records and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of your input file.
Back to top
View user's profile Send private message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Wed Apr 28, 2010 8:30 pm    Post subject:
Reply with quote

I do have a input file of RECFM=F,LRECL=40 which has 5 records and the requirements is to copy 2 new records to the input file at the end of the file as 6th and 7th and copy them in the output file.
INPUT

CURRENT-MONTH
PREV-PROCESSING-MONTH
UPDATE-VALUES
TABLE-VALUES
METHOD-TODO


OUTPUT


CURRENT-MONTH
PREV-PROCESSING-MONTH
UPDATE-VALUES
TABLE-VALUES
METHOD-TODO
NEXT-PROCESSING-MONTH
AGENCY-CODE-USED
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 239
Location: Cincinnati OH USA

PostPosted: Wed Apr 28, 2010 9:36 pm    Post subject:
Reply with quote

a classroom exercise?
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 Apr 28, 2010 10:06 pm    Post subject:
Reply with quote

Hello,

So, type the 2 new records into another file with the same dcb attributes and then concatenate them into a copy. Or simply edit the original file.

You need to provide a more complete explanation of the "requirement" and not build it up piece by piece. As posted there is no business requirement that this would support. . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Apr 28, 2010 10:52 pm    Post subject:
Reply with quote

mstp,

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/40)
//SORTOUT DD DSN=...  output file (FB/40)
//SYSIN DD *
   OPTION COPY
   OUTFIL REMOVECC,
     TRAILER1=('NEXT-PROCESSING-MONTH',/,
       'AGENCY-CODE-USED')
/*
Back to top
View user's profile Send private message
MSTP

New User


Joined: 21 Jun 2007
Posts: 29
Location: Baltimore

PostPosted: Mon May 03, 2010 10:46 pm    Post subject:
Reply with quote

thanks for the response I used dick scherrer suggestion on adding 2 new records into another new file and then concat them using copy.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us