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
 
Creating a new file from more than 1 input files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nithinlenin

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Fri Jun 15, 2007 8:16 pm    Post subject: Creating a new file from more than 1 input files
Reply with quote

I need to create a new file with columns from different file.
ie i have a file FILE1 with the 4 fields 'Name', 'address', 'phone' and 'balance'
i need to make a new file FILE2 with the fileds 'name' and 'balance' from FILE1 and alos another filed 'sex' from working storage.

Can i achieve the same using any JCL utilities or do i have to write a cobol prog for that
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jun 15, 2007 9:21 pm    Post subject:
Reply with quote

Please post samples of what your inputs look like and how you expect your outputs to look.
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: Fri Jun 15, 2007 9:23 pm    Post subject:
Reply with quote

You can do this with DFSORT. What is the starting position, length and format of 'name' and 'balance' fields in the input record? What is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
nithinlenin

New User


Joined: 06 Feb 2007
Posts: 19
Location: Hyderabad

PostPosted: Fri Jun 15, 2007 9:45 pm    Post subject:
Reply with quote

THIS ARE MY INPUT
Code:
 01 FS-FDETL-REC.
      05 FS-RECTYPE2           PIC X(05).
      05 FS-SEQ                PIC 9(10).
      05 FS-BALDATE            PIC X(08).
      05 FS-STORE              PIC X(04).
      05 FS-DOLSIGN            PIC X(01).
      05 FS-DOL.
         10 FS-DOL1            PIC 9(3).
         10 FS-DOL2            PIC 9(14)V9(04).
      05 FS-QTYSIGN            PIC X(01).
      05 FS-QTY                PIC 9(08)V9(04).
      05 FS-TRANDATE           PIC X(08).
      05 FS-REGID              PIC X(04).
      05 FS-TRANNO             PIC X(04).
      05 FS-VERNO              PIC X(04).
      05 FS-REV                PIC X(01).
      05 FS-ITEMSEQ            PIC X(04).
      05 FS-TRANTYPE           PIC X(01).
      05 FS-DEPT               PIC X(04).
      05 FS-CLASS              PIC X(04).
      05 FS-SUBCL              PIC X(04).
      05 FS-SKU                PIC X(08).
     05 FS-UPC                PIC X(13).
     05 FS-SATYPE             PIC X(04).
    05 FS-SASTAT             PIC X(01).
    05 FS-VOIDREG            PIC X(04).
    05 FS-VOIDTRAN           PIC X(04).
   05 FS-SERVTYPE           PIC X(02).

AND THE WORKING STORAGE VARIABLE
01 WS-SALESIGN PIC X(01).

AND OUT PUT SHOULD HAVE
FS-BALDATE
FS-TRANDATE
FS-STORE
FS-REGID
FS-TRANTYPE from the 1st file

and WS-SALESIGN from working storage
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jun 15, 2007 10:16 pm    Post subject:
Reply with quote

Looks like you want to do it with COBOL.......
If WS-SALESIGN is somewhat constant, Sort could do it quite easily.....
Did I get the displacements and lengths correct?
16,08 05 FS-BALDATE PIC X(08).
24,04 05 FS-STORE PIC X(04).
62,08 05 FS-TRANDATE PIC X(08).
70,04 05 FS-REGID PIC X(04).
87,01 05 FS-TRANTYPE PIC X(01).
Did I get the lrecl correct?
lrecl 136
And what value should single byte of WS-SALESIGN be?
AND OUT PUT SHOULD HAVE
FS-BALDATE
FS-TRANDATE
FS-STORE
FS-REGID
FS-TRANTYPE
WS-SALESIGN
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: Sat Jun 16, 2007 1:36 am    Post subject:
Reply with quote

nithinlenin,

Here's a DFSORT job that will do what you asked for. I didn't know what WS-SALESIGN was, so I assumed it was a constant of 'A'. Change it appropriately.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
FS-RECTYPE2,1,5
FS-SEQ,*,10
FS-BALDATE,*,8
FS-STORE,*,4
FS-DOLSIGN,*,1
FS-DOL1,*,3
FS-DOL2,*,18
FS-QTYSIGN,*,1
FS-QTY,*,12
FS-TRANDATE,*,8
FS-REGID,*,4
FS-TRANNO,*,4
FS-VERNO,*,4
FS-REV,*,1
FS-ITEMSEQ,*,4
FS-TRANTYPE,*,1
WS-SALESIGN,'A'
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTREC BUILD=(FS-BALDATE,FS-TRANDATE,FS-STORE,
    FS-REGID,FS-TRANTYPE,WS-SALESIGN)
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Jun 16, 2007 1:51 am    Post subject:
Reply with quote

Dang, that SYMNAMES is neat......
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: Sat Jun 16, 2007 5:24 am    Post subject:
Reply with quote

Glad you like it. icon_cool.gif
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Sat Jun 16, 2007 9:33 am    Post subject:
Reply with quote

Frank,

When was this SYMNAMES introduced?
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: Sat Jun 16, 2007 9:43 pm    Post subject:
Reply with quote

Quote:
When was this SYMNAMES introduced?


Way back in Sept, 1998.

You can look up when any DFSORT function was first available in my paper at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/summary_changes/srtmsocc.html
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 -> DFSORT/ICETOOL 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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
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

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