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

Creating Vsam file to Flat file and VICE-VERSA


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Sat May 03, 2008 12:29 pm
Reply with quote

Hi


Can any one let me know how to create vsam file to flat file and vice-versa using idcams or ne other method.

I tried using this


//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SEQGET01 DD DSN=test.chnage.TEST,DISP=SHR
//KSDPUT01 DD DSN=test.DATA.KSDPUT01,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=029,BLKSIZE=0)
//SYSIN DD *
REPRO INFILE(SEQGET01) OUTFILE(KSDPUT01)


/*


I am getting error


IDC3302I ACTION ERROR ON A028968.DATA.KSDPUT01
IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 C1

IDC3302I ACTION ERROR ON A028968.DATA.KSDPUT01
IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 C1

IDC3302I ACTION ERROR ON A028968.DATA.KSDPUT01
IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 C1

IDC3302I ACTION ERROR ON A028968.DATA.KSDPUT01
IDC3314I **RECORD OUT OF SEQUENCE - KEY FOLLOWS:
000000 C1

IDC3302I ACTION ERROR ON A028968.DATA.KSDPUT01


If you have JCL please post me
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat May 03, 2008 12:32 pm
Reply with quote

what does the IDC3314I **RECORD OUT OF SEQUENCE - hint ??
review Your understanding of VSAM KSDS organization
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Sat May 03, 2008 12:44 pm
Reply with quote

Its Some thing called duplicate records execeded the limit .. i guess. correct me if i m wrong
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat May 03, 2008 12:54 pm
Reply with quote

why not look at the manual

click on the IBM Manuals link at the top of the page

scroll down to
MVS System Messages Vol I Vol II Vol III Vol IV Vol V

the IDC messages should be in Vol III
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Fri May 09, 2008 2:40 pm
Reply with quote

hi i tried using this .. its working fine..


my doubt is will this affect any VSAM propetries ?

Code:

//STEP02A  EXEC  PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
  DEFINE                                                -
    CLUSTER                                           -
      ( NAME(test.file.name1)        -
        VOLUMES(PRDVSM)                          -
        INDEXED                                       -
        KEYS(14,0)                                    -
              TRACKS(30,3)                                  -
                 RECORDSIZE(80,80)                             -
                 FREESPACE(10,10)                              -
                NONSPANNED                                    -
                NOREUSE                                       -
                NOERASE                                       -
                SPEED                                         -
                SHAREOPTIONS(2,3) )                           -
            DATA                                              -
              ( NAME(test.file.name1.DATA)   -
                BUFFERSPACE(20480)                            -
                CONTROLINTERVALSIZE(4096) )                   -
            INDEX                                             -
              ( NAME(A028968.ACAPS50.TEST.ENVI.INDEX)  -
                CONTROLINTERVALSIZE(2048) )
/*
//STEP2 EXEC PGM=SORT
//SORTIN   DD  DSN=test.file.name1,DISP=SHR
//SORTOUT  DD  DSN=testfile..DATA.KSDPUT01,
//             DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(10,10),RLSE)
//SYSIN DD *
    SORT FIELDS=(1,14,BI,A)
/*
//STEP3   EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//BACKUP    DD DSN=testfile.DATA.KSDPUT01,
//             DISP=SHR
//NEWVSAM   DD DSN=Atest.file.name1,
//             DISP=OLD
//SYSIN     DD *
// REPRO INFILE(BACKUP) -
//       OUTFILE(NEWVSAM)
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Fri May 09, 2008 4:40 pm
Reply with quote

please let me know answer for my question
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 09, 2008 5:07 pm
Reply with quote

Quote:
my doubt is will this affect any VSAM propetries ?

In what way ?
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Fri May 09, 2008 5:12 pm
Reply with quote

like .. when i copy VSAM to FLAT file.. ..

1) how abt the key field
2) Should i give it as VB

when i copy from flat to vsam

1) how abt the key field .. how i can assign the same key field back.
2) should i give VB or FB
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 09, 2008 5:47 pm
Reply with quote

like .. when i copy VSAM to FLAT file.. ..

1) how abt the key field

What about the key field, it will still be there when the file is copied

2) Should i give it as VB
How have you defined the cluster ?

when i copy from flat to vsam

1) how abt the key field .. how i can assign the same key field back.

How did you assign it in the first place

2) should i give VB or FB
See cluster definition
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Fri May 09, 2008 5:49 pm
Reply with quote

so it means .. the same property will be gained again after VSAM-->FLAt-->VSAM.


Thanks for response
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 09, 2008 5:51 pm
Reply with quote

Correct.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri May 09, 2008 7:40 pm
Reply with quote

OK, this topic comes up so often I have to ask the question:

For a process that involves loading data from a sequential dataset into a VSAM KSDS dataset, is there any reason for a rank-and-file Analyst NOT to just use a SORT program and to skip using IDCAMS altogether?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 10, 2008 3:19 am
Reply with quote

Tradition (that's the way we've always done it) - and - a lack of training. . . (didn't know it could be done with the sort)

d
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Wed May 14, 2008 6:20 pm
Reply with quote

If you could sent sample jcl for the conversion ..
that will be very helpful..


i tried using the above mentioned one ..
is there any other way .???
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 14, 2008 7:14 pm
Reply with quote

Hello,

Quote:
If you could sent sample jcl for the conversion ..
There is no "conversion" - it is a simple copy from one to the other.

Quote:
i tried using the above mentioned one ..
Did this work for you or were there problems?

Quote:
is there any other way .???
Yes - as mentioned above you can copy to/from vsam/qsam(flat) format using the sort. If you searxh in the forum, you will find several examples.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top