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
 
How can v update & delete a record from PS file in assem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 12:25 pm    Post subject: How can v update & delete a record from PS file in assem
Reply with quote

Hi,

I am trying to update a record of a PS file, and in the previous posting of the same kind, they have suggested to use PUTX macro and GET macro in locate mode.

If i am trying to update empname based on empid, how do i rewrite the record in the same file.

Looking forward for some pointers. Thank you.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 12:39 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

Search for "Updating in Place" in DFSMS Using Data Sets.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 1:57 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

*********************************************
*OPEN THE FILE IN UPDATE MODE
*********************************************
OPEN (INFIL,UPDAT)
MAINLINE EQU *
GET INFIL,RECORD
MVC INREC,RECORD
CLC EMPID,CMPID
BE UPDATE
BNE NOUPDATE
*PUT THE RECORD IN TO THE OUTPUT FILE
*********************************************
UPDATE MVC EMPNAME,=CL6'SHILPU'
TPUT INREC,L'INREC
MVC RECORD,INREC
PUTX INFIL,RECORD
B MAINLINE
NOUPDATE B MAINLINE
*AT END OF FILE, CLOSE THE FILE
*********************************************
EOF CLOSE (INFIL)
***********STANDARD EXIT*********************
L 13,SAVEAREA+4
RETURN (14,12),RC=0
*********************************************
BR 14
SAVEAREA DS 18F
INFIL DCB DDNAME=INFILE,
MACRF=GM,
BLKSIZE=800,
LRECL=80,
RECFM=FB,
DSORG=PS,
EODAD=EOF
RECORD DS CL80
INREC DS 0CL80
EMPID DS CL6
EMPNAME DS CL20
DS CL54
CMPID DC CL6'E174751'
END FILEUPDT

No errors, when i run this code, but the file is not getting updated. Could you please tell me what changes has to be done to the code?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 2:22 pm    Post subject:
Reply with quote

You can use GET and PUTX macros. To use PUTX, code MACRF=(GL,PL) on the DCB macro.

You didnt do that, so you didnt read the Updating in Place part of the manual.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 2:52 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

I have changed MACRF=(GL,PL), no errors though, but nothing is getting updated in the file.

I read the updating in place, but they have used read and write. My mistake,that i didnt change MACRF to (GL,PL) in my earlier post.

Thank you.
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: Fri Jun 22, 2012 6:45 pm    Post subject:
Reply with quote

Hello,

Do NOT multi-post the same question.

As mentioned in your other topic, it is bad design to overwrite records in a sequential file. Even if you find a way, it should NOT be used.
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
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

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