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
 
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: 1249
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: 8165
Location: East Dubuque, Illinois, USA

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: 252
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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